Reef Angel Installer 0.9.0 released

Community contributed apps
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Reef Angel Installer 0.9.0 released

Post by rimai »

Hello Everyone,

I'm very happy to announce that the new Reef Angel Installer 0.9.0 is released.
You can download it at http://www.reefangel.com/Download.ashx

What is included:
  • Arduino 1.0
  • Development Libraries v0.9.0
  • RAGen for v0.9.0 libraries
  • Graphical Wifi Utility
What you should know:
The new Arduino 1.0 required us to make some changes to the libraries. We took this to also make some changes of our own for future compatibility with new hardware.
This means that your code will not compile with the new libraries and will need some minor changes, which will be explained in a later post.

Before Installing the software:
Before you update your software, make sure to backup your custom header files (ReefAngel_Features.h and ReefAngel_CustomColors.h) if you have made any changes to it.
Then, uninstall the previous Installer and RAGen software you have in your computer.
This will ensure that the software and libraries will work accordingly and you won't have duplicate software installed in your computer. The older version of installer and RAGen will be incompatible with the new software and libraries.

Installing the Software:
After downloading it, simply double-click the file to start the installation.
Follow the steps on the screen.
Last edited by binder on Tue Feb 14, 2012 6:07 am, edited 1 time in total.
Reason: Changed to Sticky
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: Reef Angel Installer 0.9.0 released

Post by rossbryant1956 »

Is this the new libraries Binder referred to last nite when he said this new version will allow us to individually address the temp sensors, regardless of the address inscribed at the factory? If yes, REALLY COOL.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Reef Angel Installer 0.9.0 released

Post by binder »

yes it is. i am working on a post to describe changes and how to use the new stuff plus what all is needed to upgrade. i am a little slow at it due to my work schedule today and tomorrow. i should have the post out tonight hopefully. if not, it will be tomorrow.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: Reef Angel Installer 0.9.0 released

Post by rossbryant1956 »

1. Has Dave Moltons client software been tested against this release?

2. Will existing documentation (specifically the wireless installation guide) still work or do I need something else.

Thx
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Installer 0.9.0 released

Post by rimai »

1. No, not tested yet.
2. If you have wifi setup, there is nothing to be changed or modified. If you have not setup your wifi, the manual has been updated to make it easier to understand and set it up. You can donwload at http://www.reefangel.com/Download.ashx
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Installer 0.9.0 released

Post by rimai »

I did a quick test and almost everything seemed to be working good with the RA Client, with exception of the expansion relay boxes that didn't show up.
Roberto.
Sebyte

Re: Reef Angel Installer 0.9.0 released

Post by Sebyte »

Hi,

If I wanted to keep the old REgen and Dev Libs. for a while, would it be ok to carry out a default 0.9.0 installation to a different drive on my system? Or would there be conflicts due to registry values?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Reef Angel Installer 0.9.0 released

Post by binder »

RAGen uses "most" of the same registry values. The Main Relay and Controller Tab are new and have their own Registry locations. The new RAGen ONLY uses the Documents\Arduino, Documents\Arduino\libraries folder, Program Files\Reef Angel Controller folder locations.

The new RAGen will auto-detect what version of the libraries you have installed and will generate the appropriate file for you. So there is no problem with the new RAGen working with the old libraries.

The old libraries will not work with the new Arduino. So you have to use the old arduino with the old libraries.

As far as the other stuff goes, I can't answer that because I don't know of the other stuff (if any) that the installer does.
Sebyte

Re: Reef Angel Installer 0.9.0 released

Post by Sebyte »

Thanks Curt for comments.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Installer 0.9.0 released

Post by rimai »

You don't need to install the 0.9.0 if you want to keep the previous version for now.
May I ask why you would want to install 0.9.0 in a different drive?
Is it to just try to play around and try to compile some codes?
Roberto.
Sebyte

Re: Reef Angel Installer 0.9.0 released

Post by Sebyte »

Curt,

Exactly, I was thinking of looking at the comparison code. Hopefully it would help build my understanding. The registry is a limitation of windows, I was wondering if setting up a virtual machine might get around the issue.

Call me a wimp, but I don't want the screw up the registry as it is such a pain to sort out :?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Reef Angel Installer 0.9.0 released

Post by binder »

The registry stuff isn't bad to worry about. My registry settings are consolidated and you can't really screw much stuff up. The registry is just to save the settings and not needed for normal usage.

Code comparison won't really lead to much differences. The functions are virtually the same. There has just been some more stuff added in 0.9.0.

Virtual machine would work just fine with testing things with it. You could run it in a VM and then force the 0.8.5.X and 0.9.0 libraries and compare the code side-by-side.
aranax
Posts: 120
Joined: Thu Jun 02, 2011 11:54 pm

Re: Reef Angel Installer 0.9.0 released

Post by aranax »

Hey Curt/Robert,
Can you guys please help me get my old sketch up and running? I'm having a bunch of issues converting this.

Here are the errors I'm getting:

Code: Select all

New_v1.cpp: In function 'void DrawCustomMain()':
New_v1:39: error: 'struct ParamsStruct' has no member named 'Temp1'
New_v1:41: error: 'struct ParamsStruct' has no member named 'Temp2'
New_v1:43: error: 'struct ParamsStruct' has no member named 'Temp3'
New_v1:73: error: 'PWMChannel' was not declared in this scope
New_v1:73: error: 'LEDPWM0' was not declared in this scope
New_v1:74: error: 'LEDPWM1' was not declared in this scope
New_v1:75: error: 'LEDPWM2' was not declared in this scope
New_v1:76: error: 'LEDPWM3' was not declared in this scope
New_v1.cpp: In function 'void loop()':
New_v1:129: error: 'PWMChannel' was not declared in this scope
New_v1:129: error: 'LEDPWM3' was not declared in this scope
New_v1:129: error: 'Moonphase' was not declared in this scope
New_v1:133: error: 'LEDPWM0' was not declared in this scope
New_v1:134: error: 'LEDPWM1' was not declared in this scope
New_v1:135: error: 'LEDPWM2' was not declared in this scope
New_v1.cpp: In function 'void CheckCloud()':
New_v1:293: error: 'PWMChannel' was not declared in this scope
New_v1:304: error: 'PWMChannel' was not declared in this scope
New_v1:305: error: 'PWMChannel' was not declared in this scope
New_v1:310: error: 'PWMChannel' was not declared in this scope
And here is the sketch I'm trying to convert:

Code: Select all

// Autogenerated file by RAGen (v1.2.1.158), (02/18/2012 22:40)
// RA_021812_2240.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DisplayLEDPWM
#define wifi
#define WDT
#define SIMPLE_MENU
#define PWMEXPANSION
#define CUSTOM_MAIN
*/


#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <ReefAngel.h>

void DrawCustomMain()
{
  ReefAngel.LCD.DrawDate(6, 120);
  pingSerial();
  ReefAngel.LCD.DrawText(T1TempColor, DefaultBGColor, 15, 10, "T1:");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp1, T1TempColor, 15+18, 10, 10);
  ReefAngel.LCD.DrawText(T2TempColor, DefaultBGColor, 15, 10+10, "T2:");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, T2TempColor, 15+18, 10+10, 10);
  ReefAngel.LCD.DrawText(T3TempColor, DefaultBGColor, 15, 10+20, "T3:");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp3, T3TempColor, 15+18, 10+20, 10);
  ReefAngel.LCD.DrawText(PHColor, DefaultBGColor, 15+60, 10, "PH:");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, PHColor, 15+78, 10, 100);
  
  //ATO status
  ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 15+60, 10+20, "Pump:");
  
  byte highcolor;
  char highstatus[10];
  
  if ( ReefAngel.HighATO.IsActive() )
    {
       ReefAngel.LCD.DrawText(PHColor, DefaultBGColor, 15+90, 10+20, "ON ");
    }
  else
    {
       ReefAngel.LCD.DrawText(T1TempColor, DefaultBGColor, 15+90, 10+20, "OFF");
    }   
  //End ATO status
  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 95, TempRelay);

  ReefAngel.LCD.DrawText(0,255,15,52,"RB:");
  ReefAngel.LCD.DrawText(0,255,15,62,"BB:");
  ReefAngel.LCD.DrawText(0,255,15,72,"CW:");
  ReefAngel.LCD.DrawText(0,255,15,82,"WW:");
  ReefAngel.LCD.DrawText(0,255,15+20,52,PWMChannel[LEDPWM0]);
  ReefAngel.LCD.DrawText(0,255,15+20,62,PWMChannel[LEDPWM1]);
  ReefAngel.LCD.DrawText(0,255,15+20,72,PWMChannel[LEDPWM2]);
  ReefAngel.LCD.DrawText(0,255,15+20,82,PWMChannel[LEDPWM3]);
}

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph(5, 5);
}


void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port2);
}

void loop()
{
    // Specific functions
    ReefAngel.StandardHeater(Port3);
    ReefAngel.StandardLights(Port4);
    ReefAngel.Relay.DelayedOn(Port5, 2);
    ReefAngel.MHLights(Port8);
    ReefAngel.Portal("aranax");

    ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.PWM.DaylightPWMSlope();

    ReefAngel.ShowInterface();

    if(ReefAngel.HighATO.IsActive())
    {
        ReefAngel.Relay.DelayedOn(Port1,1);
    }
    else
    {
        ReefAngel.Relay.Off(Port1);
    }

  
    //skimmer
    if ((hour() >= 12) && (hour() <= 21)) ReefAngel.Relay.DelayedOn(Port5,1);
    else ReefAngel.Relay.Off(Port5);    
    
    //refugium
    if ((hour() >= 12) && (hour() <= 21)) ReefAngel.Relay.Off(Port6);
    else ReefAngel.Relay.On(Port6);
    
    if ((hour() >= 12) && (hour() <= 21)) ReefAngel.Relay.On(Port7);
    else ReefAngel.Relay.Off(Port7);
    
     PWMChannel[LEDPWM3]=Moonphase();
    
  ReefAngel.ShowInterface();
  // Calculate your regular sunrise/sunset PWM value
  PWMChannel[LEDPWM0]=PWMSlope(12,30,22,00,0,80,240,PWMChannel[LEDPWM0]);
  PWMChannel[LEDPWM1]=PWMSlope(12,00,22,15,0,70,240,PWMChannel[LEDPWM1]);
  PWMChannel[LEDPWM2]=PWMSlope(13,30,21,30,0,30,180,PWMChannel[LEDPWM2]);
  PWMChannel[LEDPWM3]=PWMSlope(15,0,23,00,0,60,180,PWMChannel[LEDPWM3]);
  //PWMChannel[LEDPWM0]=PWMSlope(16,30,21,00,0,80,120,PWMChannel[LEDPWM0]);
  //PWMChannel[LEDPWM1]=PWMSlope(16,00,21,15,0,70,120,PWMChannel[LEDPWM1]);
  //PWMChannel[LEDPWM2]=PWMSlope(17,30,20,30,0,30,60,PWMChannel[LEDPWM2]);
  //PWMChannel[LEDPWM3]=PWMSlope(16,0,21,00,0,60,120,PWMChannel[LEDPWM3]);
 
  CheckCloud();
  PWMExpansion(LEDPWM0,int(2.55*PWMChannel[LEDPWM0]));
  PWMExpansion(LEDPWM1,int(2.55*PWMChannel[LEDPWM1]));
  PWMExpansion(LEDPWM2,int(2.55*PWMChannel[LEDPWM2]));
  PWMExpansion(LEDPWM3,int(2.55*PWMChannel[LEDPWM3]));

}


//*********************************************************************************************************************************
//Start of PWM slope function code designed for the PWM Expansion module
void PWMExpansion(byte cmd, byte data)
{ 
Wire.beginTransmission(8); // transmit to device #2
Wire.send('$'); // sends $ 
Wire.send('$'); // sends $ 
Wire.send('$'); // sends $ 
Wire.send(cmd); // sends a value 
Wire.send(data); // sends 255 
Wire.endTransmission(); // stop transmitting
}
//End of PWM slope function code designed for the PWM Expansion module
//*********************************************************************************************************************************



//*********************************************************************************************************************************
// Random Cloud/Thunderstorm effects function
void CheckCloud()
{

  // ------------------------------------------------------------
  // Change the values below to customize your cloud/storm effect

  // Frequency in days based on the day of the month - number 2 means every 2 days, for example (day 2,4,6 etc)
  // For testing purposes, you can use 1 and cause the cloud to occur everyday
#define Clouds_Every_X_Days 1 

  // Percentage chance of a cloud happening today
  // For testing purposes, you can use 100 and cause the cloud to have 100% chance of happening
#define Cloud_Chance_per_Day 75

  // Minimum number of minutes for cloud duration.  Don't use max duration of less than 6
#define Min_Cloud_Duration 7

  // Maximum number of minutes for the cloud duration. Don't use max duration of more than 255
#define Max_Cloud_Duration 15

  // Minimum number of clouds that can happen per day
#define Min_Clouds_per_Day 3

  // Maximum number of clouds that can happen per day
#define Max_Clouds_per_Day 5

  // Only start the cloud effect after this setting
  // In this example, start could after 11:30am
#define Start_Cloud_After NumMins(13 ,30)

  // Always end the cloud effect before this setting
  // In this example, end could before 8:00pm
#define End_Cloud_Before NumMins(18,30)

  // Percentage chance of a lightning happen for every cloud
  // For testing purposes, you can use 100 and cause the lightning to have 100% chance of happening
#define Lightning_Change_per_Cloud 60

  // Channels used by the actinic LEDs on the PWM Expansion module
  // These channels will not be dimmed when the cloud effect is triggered
  // Number is a binary form. B001100 means channel 2 and 3 are used for actinics
#define Actinic_Channels B000001

  // Channels used by the daylight LEDs on the PWM Expansion module
  // These channels will be used for the spike when lightning effect is triggered
  // Number is a binary form. B000011 means channel 0 and 1 are used for daylights
#define Daylight_Channels B001110

  // Note: Make sure to choose correct values that will work within your PWMSLope settings.
  // For example, in our case, we could have a max of 5 clouds per day and they could last for 50 minutes.
  // Which could mean 250 minutes of clouds. We need to make sure the PWMSlope can accomodate 250 minutes of effects or unforseen resul could happen.
    // Also, make sure that you can fit double those minutes between Start_Cloud_After and End_Cloud_Before.
  // In our example, we have 510 minutes between Start_Cloud_After and End_Cloud_Before, so double the 250 minutes (or 500 minutes) can fit in that 510 minutes window.
    // It's a tight fit, but it did.

    //#define printdebug // Uncomment this for debug print on Serial Monitor window
  #define forcecloudcalculation // Uncomment this to force the cloud calculation to happen in the boot process. 


    // Change the values above to customize your cloud/storm effect
  // ------------------------------------------------------------
  // Do not change anything below here

  static byte cloudchance=255;
  static byte cloudduration=0;
  static int cloudstart=0;
  static byte numclouds=0;
  static byte lightningchance=0;
  static byte cloudindex=0;
  static byte lightningstatus=0;
  static int LastNumMins=0;
  // Every day at midnight, we check for chance of cloud happening today
  if (hour()==0 && minute()==0 && second()==0) cloudchance=255;

#ifdef forcecloudcalculation
    if (cloudchance==255)
#else
    if (hour()==0 && minute()==0 && second()==1 && cloudchance==255) 
#endif
    {
      //Pick a random number between 0 and 99
      cloudchance=random(100); 
      // if picked number is greater than Cloud_Chance_per_Day, we will not have clouds today
      if (cloudchance>Cloud_Chance_per_Day) cloudchance=0;
      // Check if today is day for clouds. 
      if ((day()%Clouds_Every_X_Days)!=0) cloudchance=0; 
      // If we have cloud today
      if (cloudchance)
      {
        // pick a random number for number of clouds between Min_Clouds_per_Day and Max_Clouds_per_Day
        numclouds=random(Min_Clouds_per_Day,Max_Clouds_per_Day);
        // pick the time that the first cloud will start
        // the range is calculated between Start_Cloud_After and the even distribuition of clouds on this day. 
        cloudstart=random(Start_Cloud_After,Start_Cloud_After+((End_Cloud_Before-Start_Cloud_After)/(numclouds*2)));
        // pick a random number for the cloud duration of first cloud.
        cloudduration=random(Min_Cloud_Duration,Max_Cloud_Duration);
        //Pick a random number between 0 and 99
        lightningchance=random(100);
        // if picked number is greater than Lightning_Change_per_Cloud, we will not have lightning today
        if (lightningchance>Lightning_Change_per_Cloud) lightningchance=0;
      }
    }
  // Now that we have all the parameters for the cloud, let's create the effect

  if (cloudchance)
  {
    //is it time for cloud yet?
    if (NumMins(hour(),minute())>=cloudstart && NumMins(hour(),minute())<(cloudstart+cloudduration))
    {
      // let's go through all channels to pick which ones will be dimmed
      for (int a=0;a<6;a++)
      {
        if (bitRead(Actinic_Channels,a)==0)
        {
          // this will slope down the channel from the current PWM to 0 within 3minutes.
          // then it will stay at 0 for the duration of the cycle
          // and finally slope up from 0 to PWM value within 3 minutes
          // it is basically an inversed slope
          PWMChannel[a]-=PWMSlope(cloudstart/60,cloudstart%60,(cloudstart+cloudduration)/60,(cloudstart+cloudduration)%60,0,PWMChannel[a],3,PWMChannel[a]);
        }
      }
      if (lightningchance && (NumMins(hour(),minute())==(cloudstart+(cloudduration/2))) && second()<5) 
      {
        for (int b=0;b<6;b++)
        {
          if (bitRead(Daylight_Channels,b)==1)
          {
            if (random(100)<20) lightningstatus=1; 
            else lightningstatus=0;
            if (lightningstatus) PWMChannel[b]=100; 
            else PWMChannel[b]=0;
            //delay(10);
          }
          else
          {
            PWMChannel[b]=20;
          }
        }
      }
    }
    if (NumMins(hour(),minute())>(cloudstart+cloudduration))
    {
      cloudindex++;
      if (cloudindex < numclouds)
      {
        cloudstart=random(Start_Cloud_After+(((End_Cloud_Before-Start_Cloud_After)/(numclouds*2))*cloudindex*2),(Start_Cloud_After+(((End_Cloud_Before-Start_Cloud_After)/(numclouds*2))*cloudindex*2))+((End_Cloud_Before-Start_Cloud_After)/(numclouds*2)));
        // pick a random number for the cloud duration of first cloud.
        cloudduration=random(Min_Cloud_Duration,Max_Cloud_Duration);
        //Pick a random number between 0 and 99
        lightningchance=random(100);
        // if picked number is greater than Lightning_Change_per_Cloud, we will not have lightning today
        if (lightningchance>Lightning_Change_per_Cloud) lightningchance=0;
      }
    }
  }
  
  if (LastNumMins!=NumMins(hour(),minute()))
  {
    LastNumMins=NumMins(hour(),minute());
    
    ReefAngel.LCD.Clear(255,0,50,93,90);
    ReefAngel.LCD.DrawText(0,255,15+60,52,"CD:");
    ReefAngel.LCD.DrawText(0,255,15+60,62,"NC:");
    ReefAngel.LCD.DrawText(0,255,15+80,62,cloudindex);
    ReefAngel.LCD.DrawText(0,255,24+80,62,"of");
    ReefAngel.LCD.DrawText(0,255,38+80,62,numclouds);
    ReefAngel.LCD.DrawText(0,255,15+60,72,"CS:");
    ReefAngel.LCD.DrawText(0,255,15+80,72,"00:00");
    ReefAngel.LCD.DrawText(0,255,15+60,82,"LS:");
    ReefAngel.LCD.DrawText(0,255,15+80,82,"00:00");
    
    if (cloudchance && (NumMins(hour(),minute())<cloudstart))

    {
      
      int x=0;
      if ((cloudstart/60)>=10) x=95; else x=98;
      ReefAngel.LCD.DrawText(0,255,x,72,(cloudstart/60));
      if ((cloudstart%60)>=10) x=113; else x=119;
      ReefAngel.LCD.DrawText(0,255,x,72,(cloudstart%60));

    }

    ReefAngel.LCD.DrawText(0,255,15+80,52,cloudduration);
    if (lightningchance) 

    {
      
      int x=0;
      if (((cloudstart+(cloudduration/2))/60)>=10) x=95; else x=58;
      ReefAngel.LCD.DrawText(0,255,x,82,((cloudstart+(cloudduration/2))/60));
      if (((cloudstart+(cloudduration/2))%60)>=10) x=113; else x=119;
      ReefAngel.LCD.DrawText(0,255,x,82,((cloudstart+(cloudduration/2))%60));

    }
  }   
}

Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Reef Angel Installer 0.9.0 released

Post by binder »

There were several changes that were needed to be made. Here's a list of the changes that I made for you.
  • Temp1 ==> Temp[T1_PROBE]
  • Temp2 ==> Temp[T2_PROBE]
  • Temp3 ==> Temp[T3_PROBE]
  • Move Portal() to above ShowInterface()
  • Move ShowInterface() to be last line in loop()
  • Add LEDPWM defines back to code
  • Changed Moonphase() to MoonPhase()
  • Added PWMChannel[] array back to code
I think there are some improvements that could be made with the PWM Expansion stuff since some of the functions have now been incorporated into the libraries, but I'm simply going with the "if it's not broke, don't fix it" unless Roberto makes those changes. :)

This should work now.
Ok, here's the code:

Code: Select all


// Autogenerated file by RAGen (v1.2.1.158), (02/18/2012 22:40)
// RA_021812_2240.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DisplayLEDPWM
#define wifi
#define WDT
#define SIMPLE_MENU
#define PWMEXPANSION
#define CUSTOM_MAIN
*/


#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <ReefAngel.h>

// LEDPWM Channel defines for easy code reading
#define LEDPWM0 0
#define LEDPWM1 1
#define LEDPWM2 2
#define LEDPWM3 3
#define LEDPWM4 4
#define LEDPWM5 5

// Initial values to all 6 channels at startup.
byte PWMChannel[]={0,0,0,0,0,0};

void DrawCustomMain()
{
  ReefAngel.LCD.DrawDate(6, 120);
  pingSerial();
  ReefAngel.LCD.DrawText(T1TempColor, DefaultBGColor, 15, 10, "T1:");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T1_PROBE], T1TempColor, 15+18, 10, 10);
  ReefAngel.LCD.DrawText(T2TempColor, DefaultBGColor, 15, 10+10, "T2:");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], T2TempColor, 15+18, 10+10, 10);
  ReefAngel.LCD.DrawText(T3TempColor, DefaultBGColor, 15, 10+20, "T3:");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], T3TempColor, 15+18, 10+20, 10);
  ReefAngel.LCD.DrawText(PHColor, DefaultBGColor, 15+60, 10, "PH:");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, PHColor, 15+78, 10, 100);
  
  //ATO status
  ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 15+60, 10+20, "Pump:");
  
  byte highcolor;
  char highstatus[10];
  
  if ( ReefAngel.HighATO.IsActive() )
    {
       ReefAngel.LCD.DrawText(PHColor, DefaultBGColor, 15+90, 10+20, "ON ");
    }
  else
    {
       ReefAngel.LCD.DrawText(T1TempColor, DefaultBGColor, 15+90, 10+20, "OFF");
    }   
  //End ATO status
  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 95, TempRelay);

  ReefAngel.LCD.DrawText(0,255,15,52,"RB:");
  ReefAngel.LCD.DrawText(0,255,15,62,"BB:");
  ReefAngel.LCD.DrawText(0,255,15,72,"CW:");
  ReefAngel.LCD.DrawText(0,255,15,82,"WW:");
  ReefAngel.LCD.DrawText(0,255,15+20,52,PWMChannel[LEDPWM0]);
  ReefAngel.LCD.DrawText(0,255,15+20,62,PWMChannel[LEDPWM1]);
  ReefAngel.LCD.DrawText(0,255,15+20,72,PWMChannel[LEDPWM2]);
  ReefAngel.LCD.DrawText(0,255,15+20,82,PWMChannel[LEDPWM3]);
}

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph(5, 5);
}


void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port2);
}

void loop()
{
    // Specific functions
    ReefAngel.StandardHeater(Port3);
    ReefAngel.StandardLights(Port4);
    ReefAngel.Relay.DelayedOn(Port5, 2);
    ReefAngel.MHLights(Port8);

    // PWM Slope functions for PWM Channels on RA Head unit
    ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.PWM.DaylightPWMSlope();


    if(ReefAngel.HighATO.IsActive())
    {
        ReefAngel.Relay.DelayedOn(Port1,1);
    }
    else
    {
        ReefAngel.Relay.Off(Port1);
    }

  
    //skimmer
    if ((hour() >= 12) && (hour() <= 21)) ReefAngel.Relay.DelayedOn(Port5,1);
    else ReefAngel.Relay.Off(Port5);    
    
    //refugium
    if ((hour() >= 12) && (hour() <= 21)) ReefAngel.Relay.Off(Port6);
    else ReefAngel.Relay.On(Port6);
    
    if ((hour() >= 12) && (hour() <= 21)) ReefAngel.Relay.On(Port7);
    else ReefAngel.Relay.Off(Port7);
    
     PWMChannel[LEDPWM3]=MoonPhase();
    
  // Calculate your regular sunrise/sunset PWM value
  PWMChannel[LEDPWM0]=PWMSlope(12,30,22,00,0,80,240,PWMChannel[LEDPWM0]);
  PWMChannel[LEDPWM1]=PWMSlope(12,00,22,15,0,70,240,PWMChannel[LEDPWM1]);
  PWMChannel[LEDPWM2]=PWMSlope(13,30,21,30,0,30,180,PWMChannel[LEDPWM2]);
  PWMChannel[LEDPWM3]=PWMSlope(15,0,23,00,0,60,180,PWMChannel[LEDPWM3]);
  //PWMChannel[LEDPWM0]=PWMSlope(16,30,21,00,0,80,120,PWMChannel[LEDPWM0]);
  //PWMChannel[LEDPWM1]=PWMSlope(16,00,21,15,0,70,120,PWMChannel[LEDPWM1]);
  //PWMChannel[LEDPWM2]=PWMSlope(17,30,20,30,0,30,60,PWMChannel[LEDPWM2]);
  //PWMChannel[LEDPWM3]=PWMSlope(16,0,21,00,0,60,120,PWMChannel[LEDPWM3]);

  CheckCloud();
  PWMExpansion(LEDPWM0,int(2.55*PWMChannel[LEDPWM0]));
  PWMExpansion(LEDPWM1,int(2.55*PWMChannel[LEDPWM1]));
  PWMExpansion(LEDPWM2,int(2.55*PWMChannel[LEDPWM2]));
  PWMExpansion(LEDPWM3,int(2.55*PWMChannel[LEDPWM3]));


    ReefAngel.Portal("aranax");
    ReefAngel.ShowInterface();
}


//*********************************************************************************************************************************
//Start of PWM slope function code designed for the PWM Expansion module
void PWMExpansion(byte cmd, byte data)
{ 
Wire.beginTransmission(8); // transmit to device #2
Wire.send('$'); // sends $ 
Wire.send('$'); // sends $ 
Wire.send('$'); // sends $ 
Wire.send(cmd); // sends a value 
Wire.send(data); // sends 255 
Wire.endTransmission(); // stop transmitting
}
//End of PWM slope function code designed for the PWM Expansion module
//*********************************************************************************************************************************



//*********************************************************************************************************************************
// Random Cloud/Thunderstorm effects function
void CheckCloud()
{

  // ------------------------------------------------------------
  // Change the values below to customize your cloud/storm effect

  // Frequency in days based on the day of the month - number 2 means every 2 days, for example (day 2,4,6 etc)
  // For testing purposes, you can use 1 and cause the cloud to occur everyday
#define Clouds_Every_X_Days 1 

  // Percentage chance of a cloud happening today
  // For testing purposes, you can use 100 and cause the cloud to have 100% chance of happening
#define Cloud_Chance_per_Day 75

  // Minimum number of minutes for cloud duration.  Don't use max duration of less than 6
#define Min_Cloud_Duration 7

  // Maximum number of minutes for the cloud duration. Don't use max duration of more than 255
#define Max_Cloud_Duration 15

  // Minimum number of clouds that can happen per day
#define Min_Clouds_per_Day 3

  // Maximum number of clouds that can happen per day
#define Max_Clouds_per_Day 5

  // Only start the cloud effect after this setting
  // In this example, start could after 11:30am
#define Start_Cloud_After NumMins(13 ,30)

  // Always end the cloud effect before this setting
  // In this example, end could before 8:00pm
#define End_Cloud_Before NumMins(18,30)

  // Percentage chance of a lightning happen for every cloud
  // For testing purposes, you can use 100 and cause the lightning to have 100% chance of happening
#define Lightning_Change_per_Cloud 60

  // Channels used by the actinic LEDs on the PWM Expansion module
  // These channels will not be dimmed when the cloud effect is triggered
  // Number is a binary form. B001100 means channel 2 and 3 are used for actinics
#define Actinic_Channels B000001

  // Channels used by the daylight LEDs on the PWM Expansion module
  // These channels will be used for the spike when lightning effect is triggered
  // Number is a binary form. B000011 means channel 0 and 1 are used for daylights
#define Daylight_Channels B001110

  // Note: Make sure to choose correct values that will work within your PWMSLope settings.
  // For example, in our case, we could have a max of 5 clouds per day and they could last for 50 minutes.
  // Which could mean 250 minutes of clouds. We need to make sure the PWMSlope can accomodate 250 minutes of effects or unforseen resul could happen.
    // Also, make sure that you can fit double those minutes between Start_Cloud_After and End_Cloud_Before.
  // In our example, we have 510 minutes between Start_Cloud_After and End_Cloud_Before, so double the 250 minutes (or 500 minutes) can fit in that 510 minutes window.
    // It's a tight fit, but it did.

    //#define printdebug // Uncomment this for debug print on Serial Monitor window
  #define forcecloudcalculation // Uncomment this to force the cloud calculation to happen in the boot process. 


    // Change the values above to customize your cloud/storm effect
  // ------------------------------------------------------------
  // Do not change anything below here

  static byte cloudchance=255;
  static byte cloudduration=0;
  static int cloudstart=0;
  static byte numclouds=0;
  static byte lightningchance=0;
  static byte cloudindex=0;
  static byte lightningstatus=0;
  static int LastNumMins=0;
  // Every day at midnight, we check for chance of cloud happening today
  if (hour()==0 && minute()==0 && second()==0) cloudchance=255;

#ifdef forcecloudcalculation
    if (cloudchance==255)
#else
    if (hour()==0 && minute()==0 && second()==1 && cloudchance==255) 
#endif
    {
      //Pick a random number between 0 and 99
      cloudchance=random(100); 
      // if picked number is greater than Cloud_Chance_per_Day, we will not have clouds today
      if (cloudchance>Cloud_Chance_per_Day) cloudchance=0;
      // Check if today is day for clouds. 
      if ((day()%Clouds_Every_X_Days)!=0) cloudchance=0; 
      // If we have cloud today
      if (cloudchance)
      {
        // pick a random number for number of clouds between Min_Clouds_per_Day and Max_Clouds_per_Day
        numclouds=random(Min_Clouds_per_Day,Max_Clouds_per_Day);
        // pick the time that the first cloud will start
        // the range is calculated between Start_Cloud_After and the even distribuition of clouds on this day. 
        cloudstart=random(Start_Cloud_After,Start_Cloud_After+((End_Cloud_Before-Start_Cloud_After)/(numclouds*2)));
        // pick a random number for the cloud duration of first cloud.
        cloudduration=random(Min_Cloud_Duration,Max_Cloud_Duration);
        //Pick a random number between 0 and 99
        lightningchance=random(100);
        // if picked number is greater than Lightning_Change_per_Cloud, we will not have lightning today
        if (lightningchance>Lightning_Change_per_Cloud) lightningchance=0;
      }
    }
  // Now that we have all the parameters for the cloud, let's create the effect

  if (cloudchance)
  {
    //is it time for cloud yet?
    if (NumMins(hour(),minute())>=cloudstart && NumMins(hour(),minute())<(cloudstart+cloudduration))
    {
      // let's go through all channels to pick which ones will be dimmed
      for (int a=0;a<6;a++)
      {
        if (bitRead(Actinic_Channels,a)==0)
        {
          // this will slope down the channel from the current PWM to 0 within 3minutes.
          // then it will stay at 0 for the duration of the cycle
          // and finally slope up from 0 to PWM value within 3 minutes
          // it is basically an inversed slope
          PWMChannel[a]-=PWMSlope(cloudstart/60,cloudstart%60,(cloudstart+cloudduration)/60,(cloudstart+cloudduration)%60,0,PWMChannel[a],3,PWMChannel[a]);
        }
      }
      if (lightningchance && (NumMins(hour(),minute())==(cloudstart+(cloudduration/2))) && second()<5) 
      {
        for (int b=0;b<6;b++)
        {
          if (bitRead(Daylight_Channels,b)==1)
          {
            if (random(100)<20) lightningstatus=1; 
            else lightningstatus=0;
            if (lightningstatus) PWMChannel[b]=100; 
            else PWMChannel[b]=0;
            //delay(10);
          }
          else
          {
            PWMChannel[b]=20;
          }
        }
      }
    }
    if (NumMins(hour(),minute())>(cloudstart+cloudduration))
    {
      cloudindex++;
      if (cloudindex < numclouds)
      {
        cloudstart=random(Start_Cloud_After+(((End_Cloud_Before-Start_Cloud_After)/(numclouds*2))*cloudindex*2),(Start_Cloud_After+(((End_Cloud_Before-Start_Cloud_After)/(numclouds*2))*cloudindex*2))+((End_Cloud_Before-Start_Cloud_After)/(numclouds*2)));
        // pick a random number for the cloud duration of first cloud.
        cloudduration=random(Min_Cloud_Duration,Max_Cloud_Duration);
        //Pick a random number between 0 and 99
        lightningchance=random(100);
        // if picked number is greater than Lightning_Change_per_Cloud, we will not have lightning today
        if (lightningchance>Lightning_Change_per_Cloud) lightningchance=0;
      }
    }
  }
  
  if (LastNumMins!=NumMins(hour(),minute()))
  {
    LastNumMins=NumMins(hour(),minute());
    
    ReefAngel.LCD.Clear(255,0,50,93,90);
    ReefAngel.LCD.DrawText(0,255,15+60,52,"CD:");
    ReefAngel.LCD.DrawText(0,255,15+60,62,"NC:");
    ReefAngel.LCD.DrawText(0,255,15+80,62,cloudindex);
    ReefAngel.LCD.DrawText(0,255,24+80,62,"of");
    ReefAngel.LCD.DrawText(0,255,38+80,62,numclouds);
    ReefAngel.LCD.DrawText(0,255,15+60,72,"CS:");
    ReefAngel.LCD.DrawText(0,255,15+80,72,"00:00");
    ReefAngel.LCD.DrawText(0,255,15+60,82,"LS:");
    ReefAngel.LCD.DrawText(0,255,15+80,82,"00:00");
    
    if (cloudchance && (NumMins(hour(),minute())<cloudstart))

    {
      
      int x=0;
      if ((cloudstart/60)>=10) x=95; else x=98;
      ReefAngel.LCD.DrawText(0,255,x,72,(cloudstart/60));
      if ((cloudstart%60)>=10) x=113; else x=119;
      ReefAngel.LCD.DrawText(0,255,x,72,(cloudstart%60));

    }

    ReefAngel.LCD.DrawText(0,255,15+80,52,cloudduration);
    if (lightningchance) 

    {
      
      int x=0;
      if (((cloudstart+(cloudduration/2))/60)>=10) x=95; else x=58;
      ReefAngel.LCD.DrawText(0,255,x,82,((cloudstart+(cloudduration/2))/60));
      if (((cloudstart+(cloudduration/2))%60)>=10) x=113; else x=119;
      ReefAngel.LCD.DrawText(0,255,x,82,((cloudstart+(cloudduration/2))%60));

    }
  }   
}
aranax
Posts: 120
Joined: Thu Jun 02, 2011 11:54 pm

Re: Reef Angel Installer 0.9.0 released

Post by aranax »

Thanks Curt. I got further but I'm still having some errors.

Code: Select all

C:\Documents and Settings\jdocs\My Documents\Arduino\libraries\RA_Wifi\RA_Wifi.cpp: In function 'void processHTTP()':
C:\Documents and Settings\jdocs\My Documents\Arduino\libraries\RA_Wifi\RA_Wifi.cpp:325: error: 'class ReefAngelClass' has no member named 'PWM'
C:\Documents and Settings\jdocs\My Documents\Arduino\libraries\RA_Wifi\RA_Wifi.cpp: In function 'void SendXMLData(bool)':
C:\Documents and Settings\jdocs\My Documents\Arduino\libraries\RA_Wifi\RA_Wifi.cpp:862: error: 'class ReefAngelClass' has no member named 'PWM'
I had to change:
wire.send to wire.write
commented out (since I don't use the headunit PWM channels)
//ReefAngel.PWM.ActinicPWMSlope();
//ReefAngel.PWM.DaylightPWMSlope(); in the sketch file since I don't use the hadunit PWM channels
commented out (sketch was too big):
//#define DateTimeSetup
//#define VersionMenu
//#define DisplayLEDPWM
//#define WDT

Can you please help? Thanks again.

-J
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Reef Angel Installer 0.9.0 released

Post by binder »

You need

Code: Select all

#define DisplayLEDPWM
even though you don't use the PWM on the head unit. Since you have the Expansion Module and have PWMExpansion, you MUST include DisplayLEDPWM. That's why you are getting the error.
aranax
Posts: 120
Joined: Thu Jun 02, 2011 11:54 pm

Re: Reef Angel Installer 0.9.0 released

Post by aranax »

Thanks again Curt. I was commenting out everything I could since I'm getting the sketch too big error.

I had to ditch the storm effects :( in my file to get it to fit.
Image
aranax
Posts: 120
Joined: Thu Jun 02, 2011 11:54 pm

Re: Reef Angel Installer 0.9.0 released

Post by aranax »

I just compiled and everything compiled correctly. I just finished uploading and now my RA headunit says "No Internal Memory Found".

Everything sent fine:

Code: Select all

avrdude: Send: t [74] . [00] . [80] F [46]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [99] . [e0] . [0e] . [94] ` [60] . [0b] . [f8] . [01] f [66] . [85] w [77] . [85] . [80] . [ea] . [95] . [e0] J [4a] . [e0] P [50] . [e0] . [0e] . [94] . [b3] 9 [39] . [8c] . [e4] . [99] . [e0] . [0e] . [94] ` [60] . [0b] . [80] . [ea] . [95] . [e0] . [b7] . [01] . [0e] . [94] . [c6] 9 [39] . [81] . [e5] . [99] . [e0] . [0e] . [94] ` [60] . [0b] . [f8] . [01] . [e6] W [57] . [ff] O [4f] . [80] . [ea] . [95] . [e0] ` [60] . [81] J [4a] . [e0] P [50] . [e0] . [0e] . [94] a [61] 9 [39] . [86] . [e5] . [99] . [e0] . [0e] . [94] ` [60] . [0b] . [f8] . [01] . [e5] W [57] . [ff] O [4f] . [80] . [ea] . [95] . [e0] ` [60] . [81] J [4a] . [e0] P [50] . [e0] . [0e] . [94] a [61] 9 [39] . [8c] . [e5] . [99] . [e0] . [0e] . [94] ` [60] . [0b] . [80] . [ea] . [95] . [e0] . [b6] . [01] . [0e] . [94] . [c6] 9 [39] . [82] . [e6] . [99] . [e0] . [0e] . [94] ` [60] . [0b] . [c8] . [01] . [81] . [96] 
avrdude: Recv: . [10] 
avrdude: Send: U [55] . [00] , [2c]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: t [74] . [00] . [80] F [46]   [20] 

...deleted stuff....


avrdude: Send: U [55] . [c0] = [3d]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: t [74] . [00] . [04] F [46]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [81] 7 [37] . [ca] 7 [37] 
avrdude: Recv: . [10] 
# | 100% 14.98s

avrdude: verifying ...
avrdude: 31620 bytes of flash verified
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.

Please help...again :). Thanks.

-J
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Reef Angel Installer 0.9.0 released

Post by binder »

The "No Internal Memory Found" error is a new one that was added into the libraries for 0.9.0. You will need to use RAGen to generate a new Internal Memory file to upload OR use the included InternalMemory file to upload.

There is a value that is set in the internal memory that the controller looks for on startup. This will prevent people from accidentally forgetting to upload the Internal Memory first. The downside is that all people who are upgrading will have to set this value otherwise they will get this error.

If you don't have your initial internal memory file, then you can simply load this one to fix. It will not erase your values in internal memory, it will only tell the libraries that you have your memory set.

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <RA_NokiaLCD.h>
#include <avr/pgmspace.h>
#include <InternalEEPROM.h>
#include <Wire.h>
#include <Memory.h>


RA_NokiaLCD e;

void setup()
{
    e.Init();
    e.Clear(COLOR_WHITE,0,0,132,132);
    e.BacklightOn();

    InternalMemory.IMCheck_write(0x5241494D);
}

void loop()
{
    // display success screen
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, "Internal Memory Set");
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*4, "Now load your");
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, "   RA code file");
    delay(5000);
}
It is recommended that you load the initial values again to make sure that you don't try to use a feature that is new, but if nothing on your controller has changed other than you upgrading this will fix that problem.
aranax
Posts: 120
Joined: Thu Jun 02, 2011 11:54 pm

Re: Reef Angel Installer 0.9.0 released

Post by aranax »

Thanks Curt. I'm back up and running. As usual, the support you guys provide is top notch. Thanks again.

-J
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Reef Angel Installer 0.9.0 released

Post by binder »

aranax wrote:Thanks Curt. I'm back up and running. As usual, the support you guys provide is top notch. Thanks again.

-J
Awesome. :D Glad you are up and running again.
aranax
Posts: 120
Joined: Thu Jun 02, 2011 11:54 pm

Re: Reef Angel Installer 0.9.0 released

Post by aranax »

Hey guys,
Everything works but...is it possible that you "fixed" a bug that now causes my drivers to blink? I have the meanwell "P" drivers that only work from 15% to 100% but I never had a problem running these at ~5% to 15%. I thought I got lucky as they worked between 5% and 15% without issue (no blinking). Since I updated, I'm running into the "expected" below 15% "blinking". I didn't change anything from a hardware standpoint so I don't know what it could be.

I had to change my PWMSlope from:

PWMChannel[LEDPWM0]=PWMSlope(12,30,22,00,0,80,240,PWMChannel[LEDPWM0]);
PWMChannel[LEDPWM1]=PWMSlope(12,00,22,15,0,70,240,PWMChannel[LEDPWM1]);
PWMChannel[LEDPWM2]=PWMSlope(13,30,21,30,0,30,180,PWMChannel[LEDPWM2]);
PWMChannel[LEDPWM3]=PWMSlope(15,0,23,00,0,60,180,PWMChannel[LEDPWM3]);

to

if ((hour() >= 22,00) && (hour() <= 12,30))PWMChannel[LEDPWM0]=0;
else PWMChannel[LEDPWM0]=PWMSlope(12,30,22,00,15,80,240,PWMChannel[LEDPWM0]);

if ((hour() >= 22,00) && (hour() <= 12,30))PWMChannel[LEDPWM1]=0;
else PWMChannel[LEDPWM1]=PWMSlope(12,00,22,15,15,70,240,PWMChannel[LEDPWM1]);

if ((hour() >= 22,00) && (hour() <= 12,30))PWMChannel[LEDPWM2]=0;
else PWMChannel[LEDPWM2]=PWMSlope(12,00,22,15,15,50,240,PWMChannel[LEDPWM2]);

if (hour()>22 && hour()<4)PWMChannel[LEDPWM3]=MoonPhase();
else PWMChannel[LEDPWM3]=PWMSlope(15,0,22,00,15,60,180,PWMChannel[LEDPWM3]);

Does this make sense or did I make a mistake? Thanks.

-J
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Installer 0.9.0 released

Post by rimai »

Nothing was changed for those.
Roberto.
JoshSD
Posts: 37
Joined: Sun Dec 04, 2011 3:19 pm

Re: Reef Angel Installer 0.9.0 released

Post by JoshSD »

On a machine that previously did not have any RA software installed (XP SP3) I installed the 0.9.0 package from the download page, which installed with no errors. As an initial test, I opened RA Generator, and selected the items similar to my running sketch (which was done on another machine). After saving from RA Generator, and launching arduino 1.0, I tried to compile the sketch and got this error:


C:\Documents and Settings\Admin\My Documents\Arduino\libraries\RA_Wifi\RA_Wifi.cpp: In function 'void SendXMLData(bool)':
C:\Documents and Settings\Admin\My Documents\Arduino\libraries\RA_Wifi\RA_Wifi.cpp:982: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://sourceforge.net/tracker/?atid=52 ... unc=browse> for instructions.


The specific error changes if I select different options on the Controller tab in Generator. Removing the wifi option throws this compiler error instead:


C:\Program Files\Reef Angel Controller\libraries\Wire\Wire.cpp: In member function 'virtual size_t TwoWire::write(const uint8_t*, size_t)':
C:\Program Files\Reef Angel Controller\libraries\Wire\Wire.cpp:264: internal compiler error: Illegal instruction

I tried to reset to the default values and remove the features I'd checked (Watchdog, ATO logging, direct temp sensor) but got the same error after saving and compiling.

RA Generator -> Show Library Version displays Version 0.9.0.

Any suggestions? Thanks in advance.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Installer 0.9.0 released

Post by rimai »

I have not seen these errors before.
Roberto.
JoshSD
Posts: 37
Joined: Sun Dec 04, 2011 3:19 pm

Re: Reef Angel Installer 0.9.0 released

Post by JoshSD »

rimai wrote:I have not seen these errors before.
thanks for the quick reply. Are there any other prerequisites to the 0.9.0 installer?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Installer 0.9.0 released

Post by rimai »

No.
Everything should've been installed for you.
Roberto.
JoshSD
Posts: 37
Joined: Sun Dec 04, 2011 3:19 pm

Re: Reef Angel Installer 0.9.0 released

Post by JoshSD »

OK, no worries. I will do the configuration work on a more modern machine. The one that is throwing the errors is an older industrial PC that I am using to run the client software (works fine) so it may be the hardware that is challenged.... it's a 500MHz Via processor with 512 MB RAM :) ...

Thanks again for the quick reply. I've been really impressed with your support.
JoshSD
Posts: 37
Joined: Sun Dec 04, 2011 3:19 pm

Re: Reef Angel Installer 0.9.0 released

Post by JoshSD »

JoshSD wrote:OK, no worries. I will do the configuration work on a more modern machine.
This did the trick; no problems on a different PC.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Installer 0.9.0 released

Post by rimai »

Glad you got it working and thanks for sharing that old computers may have issues.
Roberto.
Post Reply