Migrating to 0.9

Related to the development libraries, released by Curt Binder
Post Reply
rwijbenga
Posts: 16
Joined: Thu Aug 11, 2011 11:00 am
Location: Netherlands

Migrating to 0.9

Post by rwijbenga »

Hi All,

I am trying to get my very simple sketch to work in 0.9 but I get compile errors about relay has no member. Has there something been changed with the relay function ?

What should be changed ? :?

This is my sketch:

Code: Select all

#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>


void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.SetTemperatureUnit(1);  // set to Celsius Temperature

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

void loop()
{
  ReefAngel.ShowInterface();

  // Specific functions
  ReefAngel.StandardLights(Port3);
  ReefAngel.MHLights(Port2);
  ReefAngel.StandardHeater(Port4);

//CO2
  if ( ReefAngel.Params.PH <= 675 )
    ReefAngel.Relay.Off(Port5);
  if ( ReefAngel.Params.PH >= 690  )
    ReefAngel.Relay.On(Port5);

//Bubbles
  if ( ReefAngel.Params.PH <= 580 )
    ReefAngel.Relay.On(Port7);
  if ( ReefAngel.Params.PH >= 595 )
    ReefAngel.Relay.Off(Port7);

//Chiller  
  if ( ReefAngel.Params.Temp1 >=315 ) 
    ReefAngel.PWM.SetDaylight(100);
  if ( ReefAngel.Params.Temp1 <=300 ) 
    ReefAngel.PWM.SetDaylight(0);

  if (hour()>20 || hour()<9)
  {
    ReefAngel.PWM.SetActinic(MoonPhase());
    ReefAngel.Relay.Off(Port5);
    // ReefAngel.Relay.On(Port3);
  }
  else
  {
    ReefAngel.PWM.SetActinic(0);
  
  }
  
}



rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Migrating to 0.9

Post by rimai »

What has been changed is the library names.
So the headers on top of the code needs renaming.
http://forum.reefangel.com/viewtopic.php?f=7&t=725

Try this:

Code: Select all

#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 <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <ReefAngel.h>


void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.SetTemperatureUnit(1);  // set to Celsius Temperature

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

void loop()
{
  ReefAngel.ShowInterface();

  // Specific functions
  ReefAngel.StandardLights(Port3);
  ReefAngel.MHLights(Port2);
  ReefAngel.StandardHeater(Port4);

//CO2
  if ( ReefAngel.Params.PH <= 675 )
    ReefAngel.Relay.Off(Port5);
  if ( ReefAngel.Params.PH >= 690  )
    ReefAngel.Relay.On(Port5);

//Bubbles
  if ( ReefAngel.Params.PH <= 580 )
    ReefAngel.Relay.On(Port7);
  if ( ReefAngel.Params.PH >= 595 )
    ReefAngel.Relay.Off(Port7);

//Chiller  
  if ( ReefAngel.Params.Temp[T1_PROBE] >=315 ) 
    ReefAngel.PWM.SetDaylight(100);
  if ( ReefAngel.Params.Temp[T1_PROBE] <=300 ) 
    ReefAngel.PWM.SetDaylight(0);

  if (hour()>20 || hour()<9)
  {
    ReefAngel.PWM.SetActinic(MoonPhase());
    ReefAngel.Relay.Off(Port5);
    // ReefAngel.Relay.On(Port3);
  }
  else
  {
    ReefAngel.PWM.SetActinic(0);
  
  }
  
}

Roberto.
rwijbenga
Posts: 16
Joined: Thu Aug 11, 2011 11:00 am
Location: Netherlands

Re: Migrating to 0.9

Post by rwijbenga »

I still get a strange error about the twowire.

Code: Select all

C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp: In static member function 'static void DS1307RTC::read(tmElements_t&)':
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:56: error: 'class TwoWire' has no member named 'write'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:65: error: 'class TwoWire' has no member named 'read'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:66: error: 'class TwoWire' has no member named 'read'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:67: error: 'class TwoWire' has no member named 'read'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:68: error: 'class TwoWire' has no member named 'read'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:69: error: 'class TwoWire' has no member named 'read'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:70: error: 'class TwoWire' has no member named 'read'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:71: error: 'class TwoWire' has no member named 'read'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp: In static member function 'static void DS1307RTC::write(tmElements_t&)':
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:87: error: 'class TwoWire' has no member named 'write'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:88: error: 'class TwoWire' has no member named 'write'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:89: error: 'class TwoWire' has no member named 'write'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:90: error: 'class TwoWire' has no member named 'write'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:91: error: 'class TwoWire' has no member named 'write'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:92: error: 'class TwoWire' has no member named 'write'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:93: error: 'class TwoWire' has no member named 'write'
C:\Users\rwijbenga.WA\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:94: error: 'class TwoWire' has no member named 'write'
I could not find the name change for the DS1307RTC library.

Any sugestions ?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Migrating to 0.9

Post by rimai »

I think you got a mix of old and new libraries...
You should just rename the entire libraries folder located at "Documents\Arduino\libraries" to librariesold.
Then just download latest using update utility: http://www.reefangel.com/update
Roberto.
Post Reply