adding expansion hub

Expansion modules and attachments
Post Reply
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

adding expansion hub

Post by rossbryant1956 »

Added expansion hub and additional outlet box; used test code - all seems well. Went to reload my regular *.ino and get a "undefined custom menu" error.

That would be correct since I haven't defined a custom menu, but I wasn't really ready to take that on yet; just wanted to get my regular code working again so I could begin programming for the new ports. When I attempted to remove references to the custom menu, I now get "too big" error.

Read a few of the posts about Arduino being a hog, tried that...no avail. Please help.

Code: Select all

// Autogenerated file by RAGen (v1.2.1.158), (02/17/2012 22:55)
// RA_021712_2255.ino
// Current Prod Code
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DateTimeSetup
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
#define SIMPLE_MENU
#define RelayExp
*/

#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>

/*
Ports assignment:

Port1 - Reservoir Heater
Port2 - Standard Lights
Port3 - Moon Lights
Port4 - Refugium Pumps
Port5 - WaveMaker One
Port6 - WaveMaker Two 
Port7 - Heater
Port8 - Return Pump
*/

void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.FeedingModePorts = Port4Bit | Port5Bit | Port6Bit | Port8Bit; // Turn off Port4, Port 5, Port 6, Port8 when feeding mode is activated
    ReefAngel.WaterChangePorts = Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit; // Turn off Port4, Port5, Port6, Port7 and Port8 when water change mode is activated
    ReefAngel.TempProbe = T2_PROBE;  // Set the 1st plug (which acts like the 2nd plug) 
    ReefAngel.OverheatProbe = T2_PROBE;  // to monitor the overheat and temperatures
    ReefAngel.Relay.On(Port8); // Turn on Pump
}

void loop()
{
    // Specific functions
    ReefAngel.StandardLights(Port2,8,00,23,00); // Regular Lights on at 8:00am and off at 11:00pm
    ReefAngel.StandardLights(Port3,00,30,03,30); // Moon Lights on at 12:30pm and off at 11:30pm
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.Wavemaker2(Port6);
    ReefAngel.StandardHeater(Port7);
    ReefAngel.WavemakerRandom(Port5,15,60); // Turn Port5 on/off random cycles that lasts from 15 to 60 secs
    ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5)); // Turn Port6 on/off on opposite cycle as Port 5
    // Port 5 and 6 are synchronized.
    // They work in opposing motion of each other at random times.
    // turn on port 7 when temp falls below 76.0 and turn off when temp gets above 80.0
    if (ReefAngel.Params.Temp[T2_PROBE] <= 780 && ReefAngel.Params.Temp[T2_PROBE] > 0) ReefAngel.Relay.On(Port7); 
    if (ReefAngel.Params.Temp[T2_PROBE] >= 791) ReefAngel.Relay.Off(Port7);
    if (ReefAngel.Params.Temp[T1_PROBE] <= 780 && ReefAngel.Params.Temp[T1_PROBE] > 0) ReefAngel.Relay.On(Port1);
    if (ReefAngel.Params.Temp[T1_PROBE] >= 791) ReefAngel.Relay.Off(Port1);
    ReefAngel.Portal("rossbryant1956");
   ReefAngel.ShowInterface();
}
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.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: adding expansion hub

Post by rossbryant1956 »

Code: Select all

// AutoGenerated file by RAGen (v1.2.1.158), (03/04/2012 15:52)

/*
 * Copyright 2010-12 Curt Binder
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


#ifndef __REEFANGEL_FEATURES_H__
#define __REEFANGEL_FEATURES_H__


#define DisplayImages
#define DateTimeSetup
#define DirectTempSensor
#define wifi
#define RelayExp
#define InstalledRelayExpansionModules 0
#define SIMPLE_MENU
#define CUSTOM_MAIN
#define IOEXPANSION


#endif  // __REEFANGEL_FEATURES_H__
My original goal was to add one thing at a time, following best practices so I'll know what broke when troubleshooting, so that is what I was doing, adding the additional outlets. Since I am having to seek help I went ahead and added the I/O expansion unit. I redid the instructions in re: RAGen and am attaching my *.h file for review.
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: adding expansion hub

Post by rimai »

Get rid of these:
#define DisplayImages
#define DateTimeSetup
#define DirectTempSensor
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: adding expansion hub

Post by rossbryant1956 »

I assume you mean these lines from both my .ino as well as from my .h files. I found some in both files and 1 only in the .h file. 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: adding expansion hub

Post by rimai »

The ones on the ino are just comments. I meant the ones in the .h file
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: adding expansion hub

Post by rossbryant1956 »

thx, did it. Should I have both of these in my .h

#define SIMPLE_MENU
#define CUSTOM_MAIN
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: adding expansion hub

Post by rimai »

Simple menu is a good one to reduce size and custom main is going to be applicable when you start creating your own screen.
I'm sure that with the I/O and Relay module, you will want to create your own screen.
Custom main is not being used on the cobe you posted above though.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: adding expansion hub

Post by rossbryant1956 »

I am going to pull it out so I can get the code working on simple menu. I now get this error:


reefangel.h: 106: error: "IOClass" does not name a type when I try to verify the code
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: adding expansion hub

Post by rimai »

You need the IOExpansion module in your .h file.
Open RAGen->Features Tab
Check I/O Expansion and hit save.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: adding expansion hub

Post by rossbryant1956 »

it was in my .h

This line was not in my .ino

#include <IO.h>
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.
Post Reply