Reefology's code

User avatar
Posts: 5339
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Feb 09, 2015 6:20 am
What do you want to do with them...if you want to speed one up or slow one down? Which is currently sync/antisync?

Posts: 173
Joined: Fri Dec 26, 2014 6:38 pm
PostPosted: Mon Feb 09, 2015 7:30 am
Yup, that's what I want. So do I remove the offset then? Leave it at 100? Or change it to some other figure?
Image
User avatar
Posts: 5339
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Feb 09, 2015 8:56 am
I gave you two choices...you answered yup. If you want to speed up the antisync channel then make it 125 for a 25% increase. Or make it 75 for a 25% decrease on the one set to antisync

Posts: 173
Joined: Fri Dec 26, 2014 6:38 pm
PostPosted: Mon Feb 09, 2015 11:55 am
thanks for the info Lee :)

i answered "yup" because i'd like to know how to manipulate the fields/data going forward, don't just want to rely on you guys to write code for me (though at times i need you to and certainly do appreciate it). sorry for the confusion :P
Image
User avatar
Posts: 5339
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Feb 09, 2015 4:05 pm
No worries just confusing. All good now

Posts: 173
Joined: Fri Dec 26, 2014 6:38 pm
PostPosted: Wed Nov 02, 2016 8:13 am
Hi all,

How do I figure out why I can't upload a sketch when it complies just fine?

This is the error message I'm getting:

avrdude: stk500v2_ReceiveMessage(): timeout

Same message I get when try to upload without cable. Can it be a cable issue? It seemed to work yesterday to upload wifitestcode? Sort of...
Image

Posts: 12171
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Nov 02, 2016 9:31 am
Make sure you are connecting the cable correctly on RA. It should be all the way to the right and you should have 2 pins unconnected on the left.
Roberto.

Posts: 173
Joined: Fri Dec 26, 2014 6:38 pm
PostPosted: Wed Nov 02, 2016 2:03 pm
Hi Roberto,

Yes thanks, I've uploaded sketches many times so it's definitely not that. Any other ideas?
Image

Posts: 173
Joined: Fri Dec 26, 2014 6:38 pm
PostPosted: Sat Nov 26, 2016 3:29 pm
Code: Select all
 // DC pumps
    // To run this code must choose Custom in portal
    static int rmode;
    static boolean changeMode=true;

    // These are the modes we can cycle through. You can add more and even repeat...
    byte modes[] = { NutrientTransport, Sine, ReefCrest, Lagoon, TidalSwell, ShortPulse, Sine, LongPulse, Else, Gyre, NutrientTransport };

    if (now()%1200==0 || changeMode==true) { // Change every 20 (1200seconds) mins or controller reboot
    rmode=random(100)%sizeof(modes); // Change the mode by picking from our array
    changeMode=false;
    }

    // Set timer when in feeding mode
    static unsigned long feeding;
    if (ReefAngel.DisplayedMenu==FEEDING_MODE) feeding=now();
   
    if (now()-feeding<3000) {
    // Continue NutrientTranspot Mode for 45 minutes
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.Duration=InternalMemory.DCPumpDuration_read();
    ReefAngel.DCPump.Mode=NutrientTransport;
    } else if (now()%SECS_PER_DAY<37800 || now()%SECS_PER_DAY>=81000) { // 10:30am / 10:30pm
    // Night mode (go to 30%)
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.Duration=InternalMemory.DCPumpDuration_read();
    ReefAngel.DCPump.Mode=Gyre;
    ReefAngel.DCPump.Speed=30;
    } else if (InternalMemory.DCPumpMode_read()==11) {
    // Custom Mode and nothing else going on
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.Duration=InternalMemory.DCPumpDuration_read();
    ReefAngel.DCPump.Mode=modes[rmode]; // Put the mode to the random mode :)
    ReefAngel.DCPump.Speed=InternalMemory.DCPumpSpeed_read(); // Set speed from portal
    } else {
    ReefAngel.DCPump.UseMemory=true; // Will reset all values from memory
    }

hi, based on the code above, I don't understand why my pwm channels have been at 0 for the past 45 mins? can someone help me figure out what I've done wrong? thanks
Image

Posts: 173
Joined: Fri Dec 26, 2014 6:38 pm
PostPosted: Sat Nov 26, 2016 3:29 pm
Code: Select all
 // DC pumps
    // To run this code must choose Custom in portal
    static int rmode;
    static boolean changeMode=true;

    // These are the modes we can cycle through. You can add more and even repeat...
    byte modes[] = { NutrientTransport, Sine, ReefCrest, Lagoon, TidalSwell, ShortPulse, Sine, LongPulse, Else, Gyre, NutrientTransport };

    if (now()%1200==0 || changeMode==true) { // Change every 20 (1200seconds) mins or controller reboot
    rmode=random(100)%sizeof(modes); // Change the mode by picking from our array
    changeMode=false;
    }

    // Set timer when in feeding mode
    static unsigned long feeding;
    if (ReefAngel.DisplayedMenu==FEEDING_MODE) feeding=now();
   
    if (now()-feeding<3000) {
    // Continue NutrientTranspot Mode for 45 minutes
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.Duration=InternalMemory.DCPumpDuration_read();
    ReefAngel.DCPump.Mode=NutrientTransport;
    } else if (now()%SECS_PER_DAY<37800 || now()%SECS_PER_DAY>=81000) { // 10:30am / 10:30pm
    // Night mode (go to 30%)
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.Duration=InternalMemory.DCPumpDuration_read();
    ReefAngel.DCPump.Mode=Gyre;
    ReefAngel.DCPump.Speed=30;
    } else if (InternalMemory.DCPumpMode_read()==11) {
    // Custom Mode and nothing else going on
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.Duration=InternalMemory.DCPumpDuration_read();
    ReefAngel.DCPump.Mode=modes[rmode]; // Put the mode to the random mode :)
    ReefAngel.DCPump.Speed=InternalMemory.DCPumpSpeed_read(); // Set speed from portal
    } else {
    ReefAngel.DCPump.UseMemory=true; // Will reset all values from memory
    }

hi, based on the code above, I don't understand why my pwm channels have been at 0 for the past 45 mins? can someone help me figure out what I've done wrong? thanks
Image
PreviousNext

Return to Ask anything here

Who is online

Users browsing this forum: No registered users and 3 guests