Forum Software Ferduino code Code mode pumps alternated

Code mode pumps alternated  [SOLVED]


Post Number:#1 Post Sat Jan 31, 2015 2:53 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
hello Fernado

I wanted to know if it was possible to create a way of wavemaker pumps alternated in this way

Pump 1: 0
pump 2: 0 to max then returns to 0

pump 1: 0 to max then returns to 0
pump 2: 0

and so on ....

I can not create the code

Post Number:#2 Post Sat Jan 31, 2015 3:29 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

All is possible if you want.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Sun Feb 01, 2015 3:19 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
Could you help me I did some tests but I do not work

thank you

Post Number:#4 Post Sun Feb 01, 2015 4:28 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Maybe, if you show me what you are doing.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Sun Feb 01, 2015 6:34 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
    value = int(128 + 127 * sin(2  *  PI / periodo * times));
    Pump1PWM = 255 - value;
    Pump2PWM = 0;

    Pump1PWM = 0;
    Pump2PWM = 255 - value;

Post Number:#6 Post Sun Feb 01, 2015 10:04 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

On this way Pump1PWM never will be different of zero.

You need add conditions to alternate between this two cases.

By example during how many seconds the values will be Pump1PWM = 255 - value and Pump2PWM = 0.

Adding a Serial.println(Pump1PWM); and Serial.println(Pump2PWM); can help you learn how it change of value.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#7 Post Mon Feb 02, 2015 10:02 am
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
sorry I can not understand where I enter the Serial.println

Post Number:#8 Post Tue Feb 03, 2015 9:51 am
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
Could you help me?

thank you

Post Number:#9 Post Sat Apr 25, 2015 9:46 am
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
I did many tests but I can not do this function

please help me?

Post Number:#10 Post Fri Jun 26, 2015 3:04 am
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
but serialprint not need to write the messages on the display?

I can not understand how I should set up the command

Post Number:#11 Post Sun Jun 28, 2015 12:12 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Try learn the basic first.

Google it.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#12 Post Sun Jul 26, 2015 2:00 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
should I use a Millis right?

but I do not know how to set it up

help me?

Post Number:#13 Post Sat Sep 26, 2015 4:50 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
do not help me please ???? :( :( :( ^:)^

Post Number:#14 Post Sun Sep 27, 2015 3:12 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

After all this time let me see the code that you wrote.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#15 Post Sun Sep 27, 2015 3:24 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
I am still stuck to the code I posted above I do not know how to move forward and for this I ask help

thank you

Post Number:#16 Post Tue Sep 29, 2015 3:40 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

I really think that you only want the code done.

Try this:

Ferduino tab:

// Global variables
unsigned long millis_step = 0;
byte step = 0;
int step_time = 1000; // milliseconds


Wavemaker tab:

  else if (modo_selecionado == 5)
  {
    if (step == 0)
    {
      if ((millis() - millis_step) > step_time)
      {
        Pump1PWM += 1;
        Pump2PWM = 0;
        millis_step = millis();
      }
      if (Pump1PWM == 255)
      {
        step = 1;
      }
    }
    else if (step == 1)
    {
      if ((millis() - millis_step) > step_time)
      {
        Pump1PWM -= 1;
        Pump2PWM = 0;
        millis_step = millis();
      }
      if (Pump1PWM == 0)
      {
        step = 2;
      }
    }
    else if (step == 2)
    {
      if ((millis() - millis_step) > step_time)
      {
        Pump1PWM = 0;
        Pump2PWM += 1;
        millis_step = millis();
      }
      if (Pump2PWM == 255)
      {
        step = 3;
      }
    }
    else if (step == 3)
    {
      if ((millis() - millis_step) > step_time)
      {
        Pump1PWM = 0;
        Pump2PWM -= 1;
        millis_step = millis();
      }
      if (Pump2PWM == 0)
      {
        step = 0;
      }
    }
  }


It will replace manual mode so the buttons + and - on touch will be useless.

It's very basic and only with this tutorial is possible write this function: https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay

Please do not ask me to make other custom function for you.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#17 Post Mon Jul 18, 2016 6:13 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
Thanks for your help

I wanted to decrease the step_time 1000 milliseconds to 10 millisecond to increase the speed of climb and descent

I located a problem if I'm okay in wavemaker screen works well if I move on the home screen does not keep him more step_time set but charged on a much more high speed and the pumps are only small movements

I controlled via serial monitor effects the speed of the count and very fast

I do not understand why it seems that outside the screen wavemaker does not take account of step_time

thank you

Post Number:#18 Post Tue Jul 19, 2016 10:36 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

I can't see any problem since 10 milliseconds is very fast even and the PWM keeps high during a small amount of time.

The speed seems smaller in wavemaker screen because the controller is spending time to update the screen all time and in home screen it doesn't happens.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#19 Post Tue Jul 19, 2016 5:03 pm
Posts: 101
Topics: 22
Solve rating: 0
Joined: Wed Sep 10, 2014 7:07 pm
Topics: 22
Age: 49
Gender: None specified
National Flag:
Italy
I connected the pumps when they step to the start menu the pumps do not follow more times and go much faster do not know if I explained

if I use the mode 1 or 2 etc. the defect does not occur

step_time if I put it in 1000 operates all right

but quersto way pome go real slow I would like the mode 1 and 2 speed but if I lower the time to 10 I leave the screen in wavemaker works well if I go back to the home screen changes speeds very strong as if not taking the spet_time
Last edited by Simone Sandonati on Tue Jul 19, 2016 5:09 pm, edited 1 time in total.

Post Number:#20 Post Tue Jul 19, 2016 5:05 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

I don't understand, a video can help.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Next



  • Similar Topics
    Replies
    Views
    Last post

Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron