Some issues with my code.

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Some issues with my code.

Post by Sacohen »

I'll keep an eye out for something.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Some issues with my code.

Post 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) {
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Some issues with my code.

Post 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) {
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Some issues with my code.

Post 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.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Some issues with my code.

Post 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 {
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Some issues with my code.

Post by Sacohen »

I'll do it tonight.

Thanks.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Some issues with my code.

Post 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.
Post Reply