Well... here is my complete code and getting the error.
Note, this code may appear a little funny to people on here, it is an ongoing process...
#include <Time.h>
#include <x10.h>
#include <x10constants.h>
#define zcPin 2
#define dataPin 3
String timenow;
byte devices[]={
"UNIT_1", // dining room
"UNIT_2", // front outside
"UNIT_3", // back deck
"UNIT_4", // stairs up
"UNIT_5", // front window
"UNIT_6", // hut
"UNIT_7", // back garage
"UNIT_8", // entrance
"UNIT_9", // Stairs down
"UNIT_10", // basement ceiling
"UNIT_11", // basement lamps
"UNIT_12"}; // basement over TV
char* Ontime[]={"8:0","8:30","8:30","8:10","8:10","8:10","8:30","8:10","8:10","","",""};
char* Offtime[]={"8:1","3:0","3:0","0:30","0:30","0:30","3:0","0:30","0:30","","",""};
// t for on/off from timer, m for manual, will figure something better later...
char* mode[]={"t","t","t","t","t","t","t","t","t","m","m","m"};
// 0= on/off lights, >0 = Dimmed lights
int val[]={10,0,0,30,0,0,0,30,30,30,0,0};
// 0=off, 1=on
int stat[]={0,0,0,0,0,0,0,0,0,0,0,0};
x10 myHouse = x10(zcPin, dataPin);
void setup()
{
Serial.begin(9600);
// will get time from NTP when I receive Ethenet shield, for now...
setTime(7,59,55,6,7,13); // set time to noon Jan 1 2011
// myHouse.write(HOUSE_B, UNIT_1, 1);
// myHouse.write(HOUSE_B, OFF, 1);
}
void loop()
{
// check what time it is
timenow = String(hour()) + ":" + String(minute());
for (int i=0; i<11; i++){
// Turn on or off devices that are timed
if (mode[i] == "t"){
if (timenow == Ontime[i] && stat[i] == 0){
myHouse.write(HOUSE_B, devices[i], 1);
if (val[i] > 0){
myHouse.write(HOUSE_B, ON, 1);
myHouse.write(HOUSE_B, DIM, val[i]);
stat[i] = 1;
Serial.print("dim ");
Serial.print(val[i]);
Serial.print(" and stat = ");
Serial.print(stat[i]);
Serial.println("");
}
}
}
if (mode[i] == "t"){
if (timenow == Offtime[i] && stat[i] == 1){
myHouse.write(HOUSE_B, devices[i], 1);
myHouse.write(HOUSE_B, OFF, 1);
stat[i] = 0;
Serial.print("off ");
Serial.print(val[i]);
Serial.print(" and stat = ");
Serial.print(stat[i]);
Serial.println("");
}
}
// if button1 pressed set TV time
// if button2 pressed set good night time
// check door switches and beep if open
}
}
I am getting this error:
HouseControl:22: error: too many initializers for 'byte []'