Some issues with my code.

Do you have a question on how to do something.
Ask in here.
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Fri Jun 27, 2014 9:40 am
I'll keep an eye out for something.
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Jun 27, 2014 9:47 am
Ahh I know what the issue is!! rmode is our random number in the array... not the actual mode.

Try this:

Code: Select all
if (modes[rmode]==Else) {
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Fri Jun 27, 2014 10:08 am
OK. I'll try it tonight or tomorrow.
I can't seem to log into my laptop remotely right now to make the change.

lnevo wrote:Change this line

Code: Select all
  if (rmode==Else) {


to

Code: Select all
  if (modes[rmode]==Else) {
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Fri Jun 27, 2014 11:07 am
You're the man.
That seemed to do it.
It shows a Pump Mode of constant, but the speed is not I't changing (as it should be).

Thanks Lee.
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Jun 27, 2014 11:24 am
but the speed is not I't changing (as it should be).


Speed should be changing as every iteration of loop we are setting the speed to ElseMode(InternalMemory.DCPumpSpeed_read(),20,true)

There are a few issues though, one is that we would not get any sync/anti-sync functionality there. I think we should revert to using the PWM commands here. Let's try this:

Code: Select all
  if (rmode==Else) {
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.Mode=Constant;
    ReefAngel.DCPump.Speed=ElseMode(InternalMemory.DCPumpSpeed_read(),20,true );    // ElseMode on sync mode, Portal Speed Setting +/- 20%
  } else {


Code: Select all
  if (rmode==Else) {
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.PWM.SetDaylight(ElseMode(InternalMemory.DCPumpSpeed_read(),20,true) );    // ElseMode on sync mode, Portal Speed Setting +/- 20%
    ReefAngel.PWM.SetActinic(ElseMode(InternalMemory.DCPumpSpeed_read(),20,false) );    // ElseMode on anti-sync mode, Portal Speed Setting +/- 20%
  } else {
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Fri Jun 27, 2014 11:29 am
I'll do it tonight.

Thanks.
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Fri Jun 27, 2014 12:46 pm
Thanks Lee.
I'm going to put this issue to the side for now until I iron out some hardware issues that Roberto and I have been trying to figure out,

I don't want to introduce anything new into the mix right now.
Previous

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 4 guests

cron