Page 1 of 1

Re: Some issues with my code.

Posted: Fri Jun 27, 2014 9:40 am
by Sacohen
I'll keep an eye out for something.

Re: Some issues with my code.

Posted: Fri Jun 27, 2014 9:47 am
by lnevo
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) {

Re: Some issues with my code.

Posted: Fri Jun 27, 2014 10:08 am
by Sacohen
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) {

Re: Some issues with my code.

Posted: Fri Jun 27, 2014 11:07 am
by Sacohen
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.

Re: Some issues with my code.

Posted: Fri Jun 27, 2014 11:24 am
by lnevo
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 {

Re: Some issues with my code.

Posted: Fri Jun 27, 2014 11:29 am
by Sacohen
I'll do it tonight.

Thanks.

Re: Some issues with my code.

Posted: Fri Jun 27, 2014 12:46 pm
by Sacohen
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.