WP40 on the ATO PWM & Custom code

Do you have a question on how to do something.
Ask in here.
Post Reply
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WP40 on the ATO PWM & Custom code

Post by rimai »

I think you can do once, but just in case keep it everytime you use digitalWrite, just because the ATO port is setup as input and not as output.
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: WP40 on the ATO PWM & Custom code

Post by lnevo »

Roberto wonder if that may be the problem for the person who had issue in feeding/wc mode with the lowAto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: WP40 on the ATO PWM & Custom code

Post by rimai »

Humm... not sure
Roberto.
ganjero
Posts: 147
Joined: Fri Jul 05, 2013 5:29 am

Re: WP40 on the ATO PWM & Custom code

Post by ganjero »

Well I tried this

Code: Select all

if (ReefAngel.DisplayedMenu==FEEDING_MODE)
                StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 5400) // if feeding started between 1800 and 5400 seconds
               pinMode(lowATOPin,OUTPUT)
               analogWrite(lowATOPin,100*2.55);
              else
                pinMode(lowATOPin,OUTPUT)
                analogWrite(lowATOPin,75*2.55);
and got an error on "else" - it says "there is not an if" before

so I just changed it to this, and it's working fine

Code: Select all

   ....
            ReefAngel.StandardLights( Port1,14,0,19,0 );
            ReefAngel.StandardLights( Port2,15,0,20,0 );
            ReefAngel.StandardLights( Port3,19,55,22,0 );
            ReefAngel.StandardLights( Port4,14,0,20,15 );
            ReefAngel.StandardHeater( Port5,780,785 );
            ReefAngel.StandardFan( Port6,780,800 );
            ReefAngel.StandardLights( Box1_Port5,22,0,16,0 );
            ReefAngel.DCPump.UseMemory = true;
            pinMode(lowATOPin,OUTPUT);
            ....
            static time_t StartFeeding=0;
              if (ReefAngel.DisplayedMenu==FEEDING_MODE)
                StartFeeding=now(); // if we entered feeding mode, register what time it was.
              if (now()-StartFeeding > 1800 && now()-StartFeeding < 5400) // if feeding started between 1800 and 5400 seconds
               analogWrite(lowATOPin,100*2.55);
              else
                analogWrite(lowATOPin,60*2.55);
             ....
            
Image
89delta
Posts: 163
Joined: Mon Oct 15, 2012 7:21 pm
Location: Leesburg, GA

Re: WP40 on the ATO PWM & Custom code

Post by 89delta »

What's the difference between the regular cables and the ATO cable for jebao?
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: WP40 on the ATO PWM & Custom code

Post by cosmith71 »

You have to remove a resistor (surface mount) on the cable for it to work properly with the 5V ATO signal. There's a thread around here somewhere that points it out.

--Colin
89delta
Posts: 163
Joined: Mon Oct 15, 2012 7:21 pm
Location: Leesburg, GA

Re: WP40 on the ATO PWM & Custom code

Post by 89delta »

Thanks, found it.
Post Reply