Writing my code - help

Share you PDE file with our community
Post Reply
Blawson
Posts: 37
Joined: Sat Apr 14, 2012 10:02 pm

Writing my code - help

Post by Blawson »

So I am trying to put together my new code. My first order of business is getting the AI Nano working. Here is my code:
// Autogenerated file by RAGen (v1.2.2.171), (05/28/2012 19:48)
// RA_052812_1948.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DisplayImages
#define WavemakerSetup
#define DateTimeSetup
#define VersionMenu
#define ATOSetup
#define MetalHalideSetup
#define DisplayLEDPWM
#define wifi
#define StandardLightSetup
#define PWMEXPANSION
#define AI_LED
*/


#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 <AI.h>
#include <ReefAngel.h>


////// Place global variable code below here


////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init(); //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
    ////// Place additional initialization code below here
    ReefAngel.AI.SetPort(highATOPin);

    ////// Place additional initialization code above here
}

void loop()
{
    // Specific functions that use Internal Memory values
    ReefAngel.StandardATO(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.MHLights(Port3);
    ReefAngel.StandardFan(Port4);
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.Wavemaker2(Port6);
    ReefAngel.StandardHeater(Port7);

    
    ////// Place your custom code below here
    if (hour()>=22 || hour()<10)
    {
    ReefAngel.AI.SetChannel(White,0);
    ReefAngel.AI.SetChannel(Blue,MoonPhase()*0.07);
    ReefAngel.AI.SetChannel(RoyalBlue,MoonPhase()*0.07);
    }
    else
    {
    ReefAngel.AI.SetChannel(White,PMWSlope(10,0,21,0,3,30,200,3));
    ReefAngel.AI.SetChannel(Blue,PMWSlope(10,0,21,0,3,30,200,3));
    ReefAngel.AI.SetChannel(RoyalBlue,PMWSlope(10,0,21,0,3,30,200,3));
    }
    ////// Place your custom code above here
    // This sends all the data to the portal
    // Do not add any custom code that changes any relay status after this line
    // The only code after this line should be the ShowInterface function
    ReefAngel.Portal("blawson", "XXXXXXXX");

    // This should always be the last line
    ReefAngel.ShowInterface();
}

I keep getting an error:
Test_PMW.cpp: In function 'void loop()':
Test_PMW:81: error: 'PMWSlope' was not declared in this scope

I know I have a lot of work on this code - but want to get the slope right first. I need help with the error and then I want to understand what the parameters are for the slope:
White,PMWSlope(10,0,21,0,3,30,200,3)
I am decent at understanding coding but I cannot find a list of parameters for this.

Any help will be appreciated!

Brian
Last edited by Blawson on Mon May 28, 2012 10:27 pm, edited 1 time in total.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Writing my code - help

Post by rimai »

Typo :)
Change PMWSlope to PWMSlope
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Writing my code - help

Post by rimai »

Then look at this thread for a brief explanation:
http://forum.reefangel.com/viewtopic.php?f=12&t=16
Roberto.
Blawson
Posts: 37
Joined: Sat Apr 14, 2012 10:02 pm

Re: Writing my code - help

Post by Blawson »

I am a dork!

Thanks for the catch! Next question - is there a way to control the AI Nano from my iPhone? i.e. - can I dim channels seperately? Can I start a storm?

As stated above - a lot to do on this but one thing at a time.

Thanks
brian
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Writing my code - help

Post by rimai »

That is not implemented yet.
Maybe we should bug wolfador to give us that option for the iPhone app? :)
http://forum.reefangel.com/viewtopic.php?f=8&t=35
He also has AI nano in his tank. In fact, he's got 2 of them.
Roberto.
Post Reply