Is the else mode included in the new libraries?
I still have this code at the end of my sketch. If the else mode is included in the new libraries then I can remove this piece of code, right?
byte ElseMode( byte MidPoint, byte Offset, boolean WaveSync )
{
// Static's only initialize the first time they are called
static unsigned long LastChange=millis(); // Set the inital time that the last change occurred
static int Delay = random( 500, 3000); // Set the initial delay
static int NewSpeed = MidPoint; // Set the initial speed
static int AntiSpeed = MidPoint; // Set the initial anti sync speed
if ((millis()-LastChange) > Delay) // Check if the delay has elapsed
{
Delay=random(500,5000); // If so, come up with a new delay
int ChangeUp = random(Offset); // Amount to go up or down
if (random(100)<50) // 50/50 chance of speed going up or going down
{
NewSpeed = MidPoint - ChangeUp;
AntiSpeed = MidPoint + ChangeUp;
}
else
{
NewSpeed = MidPoint + ChangeUp;
AntiSpeed = MidPoint - ChangeUp;
}
LastChange=millis(); // Reset the time of the last change
}
if (WaveSync)
{
return NewSpeed;
}
else
{
return AntiSpeed;
}
}
Else mode in new libraries?
9 posts
• Page 1 of 1
|
|
Not in the libraries. Not sure if it will be...it's very close to the reef-crest code.
|
|
my apologies for hijacking this thread....but I am experiencing a problem..I opened arduino today and it told me there is an update...I updated and now my code wont load onto the controller..i have the following error
"Globals\Globals.cpp.o: In function `ElseMode(unsigned char, unsigned char, unsigned char)': C:\Users\Ridwaan.DellUser-PC\Documents\Arduino\libraries\Globals/Globals.cpp:881: multiple definition of `ElseMode(unsigned char, unsigned char, unsigned char)' sketch_nov09a.cpp.o:C:\Users\RIDWAA~1.DEL\AppData\Local\Temp\build8546684784534505203.tmp/sketch_nov09a.cpp:156: first defined here c:/program files (x86)/reef angel controller/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions" I am not sure what to do?..please help |
|
Also, just to keep in mind..i am not a programmer...But im good at copying and psting and that's how I got my reef angel working the way I like it...lol
so yes, I need your help asap |
|
You need to take the ElseMode section out of your code. What this error says is that it exists twice. Once in your code, and now, once in the libraries.
Post your code and I can show you what to take out. --Colin |
|
Cool Thanks so much...here is my code
|
|
I think this should do it. I just removed the ElseMode() function from your code, since it's in the new libraries now.
|
|
Thanks...that worked!
Learnt something new... |
|
Is it possible to change Display Mode of grid/fields by Javascripts in Dynaform, if yes, how to compile the scripts, can you make an example.
Thanks. |
|
9 posts
• Page 1 of 1
Return to Development Libraries
Who is online
Users browsing this forum: No registered users and 1 guest