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: Mon Jun 23, 2014 4:24 pm
1st whenever "Else Mode" comes up in the random wave patterns the portal shows every option available.

Image

Image

Here is some of the testing that you Roberto and I did under Paul'd thread...

I've set the code to only have the Else mode as an option and them I checked the r99 out up and there is no 255 in the DCS, DCM and DCD.

They are actually set to the setting I have in portal.

<DCM>16</DCM>
<DCS>50</DCS>
<DCD>30</DCD>

The 16 for DCM is what the Else mode is defined as in the code...

// Add Else Mode definition..
const int Else=16;

In addition I added the ReefAngel.DCPump.UseMemory=false; to the code and the Portal is still messed up.

Question from Lee to Roberto...
Roberto could that be screwing with the portal though?

The mode should show 11 since its part of our custom mode.

This could be part of the issue...


Roberto's Response

Yeah... I think so.


Lee's response...

Do you think it would be better to fix it on the backend? I mean if someone didn't initialize memory they would have the 255 issue we saw earlier? Either way I can fix in the INO. Steve, can you update your thread with latest version if its not already?


Also is Lee was going to work on a way to set different speeds for different pumps.
User avatar
Posts: 5409
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jun 23, 2014 4:35 pm
You shouldnt be using Else to set DCpump. Its invalid. DCPump.Mode should be getting set to custom.

I'll look at your code again to see whats up.
User avatar
Posts: 5409
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jun 23, 2014 4:36 pm
For different speeds i think roberto and alan may have addressed it someway...need roberto to chime in.
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Mon Jun 23, 2014 4:41 pm
I'm just using the code you gave me.

You know I don't know enough about coding to set that up.

Sent from my HTC One VX using Tapatalk
User avatar
Posts: 5409
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jun 23, 2014 4:43 pm
I know... just need to see what we're doing. You have the random bit, so i may have made an assumption that i shouldnt have. But look how far you've come. You identified exactly the issue after going through all the troubleshooting :)
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Mon Jun 23, 2014 4:45 pm
That was all TS that you and Roberto did with me, but thank you.

Sent from my HTC One VX using Tapatalk
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Tue Jun 24, 2014 10:42 am
I started testing this again and removed everything from the available choices except Else Mode.
When the RA rebooted the Portal is not showing me everything like it was before.

It is now showing the Portal as it should, but the DC Pump Mode is listed as whatever it was before I removed all the other options and rebooted.

For Example Before the Reboot the Portal displayed that it was in Reef Crest mode and after I rebooted the Portal still says it's in Reef Crest mode even though that was not one of the options that it could choose from.

I'm sure that it is displaying the last mode it was in because there is not Else in the Libraries for it to display.

This is acceptable. I just hated every option available to the RA showing up on screen.
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Tue Jun 24, 2014 10:51 am
OK. I spoke to soon.
I put all on my choices back in my code and uploaded it to the unit and when I refreshed the Portal it was showing me every option available again and was displaying "Reef Crest" ass the mode type under DC Pumps.
User avatar
Posts: 5409
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Jun 27, 2014 9:32 am
Code: Select all
    ReefAngel.DCPump.Mode=modes[rmode];  // Put the mode to the random mode :)


This is the line that is causing it because we are setting the mode ReefAngel.DCPump.Mode to the random mode which includes Else. I'll have a better method shortly. Just wanted to post this :)
User avatar
Posts: 5409
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Jun 27, 2014 9:34 am
Actually, we were doing that already... and it should be getting set to Constant.. hmm

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 {
    ReefAngel.DCPump.Mode=modes[rmode];  // Put the mode to the random mode :)
    ReefAngel.DCPump.Speed=InternalMemory.DCPumpSpeed_read(); // Set speed from portal
  }
Next

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 2 guests

cron