I try to use 10 door/window magnetic sensors with z-uno.
I have write this code:
Code: Select all
/*
* This scretch was certified by the Z-Wave Alliance as one of the two reference Z-Uno sketches.
*
* 10 door sensor
*
*/
// Pins definitions
#define DoorPin1 1
#define DoorPin2 2
#define DoorPin3 3
#define DoorPin4 4
#define DoorPin5 5
#define DoorPin6 6
#define DoorPin7 7
#define DoorPin8 8
#define DoorPin9 9
#define DoorPin10 10
// Global variables to store data reported via getters
byte lastDoorValue1 = 0;
byte lastDoorValue2 = 0;
byte lastDoorValue3 = 0;
byte lastDoorValue4 = 0;
byte lastDoorValue5 = 0;
byte lastDoorValue6 = 0;
byte lastDoorValue7 = 0;
byte lastDoorValue8 = 0;
byte lastDoorValue9 = 0;
byte lastDoorValue10 = 0;
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE);
ZUNO_SETUP_ASSOCIATIONS(ZUNO_ASSOCIATION_GROUP_SET_VALUE); // Send Basic Set to association group
// Set up 10 channels
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor1)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor2)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor3)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor4)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor5)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor6)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor7)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor8)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor9)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getterDoor10)
);
void setup() {
// set up I/O pins. Analog and PWM will be automatically set up on analogRead/analogWrite functions call
pinMode(DoorPin1, INPUT_PULLUP);
pinMode(DoorPin2, INPUT_PULLUP);
pinMode(DoorPin3, INPUT_PULLUP);
pinMode(DoorPin4, INPUT_PULLUP);
pinMode(DoorPin5, INPUT_PULLUP);
pinMode(DoorPin6, INPUT_PULLUP);
pinMode(DoorPin7, INPUT_PULLUP);
pinMode(DoorPin8, INPUT_PULLUP);
pinMode(DoorPin9, INPUT_PULLUP);
pinMode(DoorPin10, INPUT_PULLUP);
}
void loop() {
byte currentDoorValue1;
byte currentDoorValue2;
byte currentDoorValue3;
byte currentDoorValue4;
byte currentDoorValue5;
byte currentDoorValue6;
byte currentDoorValue7;
byte currentDoorValue8;
byte currentDoorValue9;
byte currentDoorValue10;
// Door/Window sensor
currentDoorValue1 = digitalRead(DoorPin1);
if (currentDoorValue1 != lastDoorValue1) {
lastDoorValue1 = currentDoorValue1;
zunoSendReport(10);
}
// Door/Window sensor
currentDoorValue2 = digitalRead(DoorPin2);
if (currentDoorValue2 != lastDoorValue2) {
lastDoorValue2 = currentDoorValue2;
zunoSendReport(2);
}
// Door/Window sensor
currentDoorValue3 = digitalRead(DoorPin3);
if (currentDoorValue3 != lastDoorValue3) {
lastDoorValue3 = currentDoorValue3;
zunoSendReport(3);
}
// Door/Window sensor
currentDoorValue4 = digitalRead(DoorPin4);
if (currentDoorValue4 != lastDoorValue4) {
lastDoorValue4 = currentDoorValue4;
zunoSendReport(4);
}
// Door/Window sensor
currentDoorValue5 = digitalRead(DoorPin5);
if (currentDoorValue5 != lastDoorValue5) {
lastDoorValue5 = currentDoorValue5;
zunoSendReport(5);
}
// Door/Window sensor
currentDoorValue6 = digitalRead(DoorPin6);
if (currentDoorValue6 != lastDoorValue6) {
lastDoorValue6 = currentDoorValue6;
zunoSendReport(6);
}
// Door/Window sensor
currentDoorValue7 = digitalRead(DoorPin7);
if (currentDoorValue7 != lastDoorValue7) {
lastDoorValue7 = currentDoorValue7;
zunoSendReport(7);
}
// Door/Window sensor
currentDoorValue8 = digitalRead(DoorPin8);
if (currentDoorValue8 != lastDoorValue8) {
lastDoorValue8 = currentDoorValue8;
zunoSendReport(8);
}
// Door/Window sensor
currentDoorValue9 = digitalRead(DoorPin9);
if (currentDoorValue9 != lastDoorValue9) {
lastDoorValue9 = currentDoorValue9;
zunoSendReport(9);
}
// Door/Window sensor
currentDoorValue10 = digitalRead(DoorPin10);
if (currentDoorValue10 != lastDoorValue10) {
lastDoorValue10 = currentDoorValue10;
zunoSendReport(10);
}}
// Getters and setters
byte getterDoor(void) {
return lastDoorValue1 ? 0xff : 0;
}
Do you have any ideas to solve this error?Arduino: 1.6.5 (Mac OS X), Board: "Z-Wave>ME Z-Uno, Europe, Enabled, Enabled"
Build options changed, rebuilding all
/Users/Michel/Library/Arduino15/packages/Z-Uno/tools/zuno_toolchain/00.08.10/zuno_toolchain/compiler build /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/doorsensorzuno.cpp -r /Users/Michel/Library/Arduino15/packages/Z-Uno/hardware/zw8051/2.0.6
************* Building Arduino Sketch *************
/var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/doorsensorzuno.cpp
***************************************************
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Print.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Print_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Stream.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Stream_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/HardwareSerial.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/HardwareSerial_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/HLCore.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/HLCore_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/_doorsensorzuno.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/_doorsensorzuno_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Print.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Print_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Stream.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Stream_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/HardwareSerial.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/HardwareSerial_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/HLCore.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/HLCore_sdcpp_.cpp ...
Preprocessing file: /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/_doorsensorzuno.cpp with SDCPP...
Compiling /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/_doorsensorzuno_sdcpp_.cpp ...Compiling file "/var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/LLCore_arduino.c" by means of SDCC...
at 1: warning 119: don't know what to do with file ''. file extension unsupported
sdcc: Calling preprocessor...
sdcc: sdcpp -nostdinc -Wall -obj-ext=.rel -D__SDCC_STACK_AUTO -D__SDCC_MODEL_LARGE -D__SDCC_INT_LONG_REENT -D__SDCC_FLOAT_REENT -D__SDCC=3_5_0 -DSDCC=350 -D__SDCC_REVISION=9253 -D__SDCC_mcs51 -D__STDC_NO_COMPLEX__ -D__STDC_NO_THREADS__ -D__STDC_NO_ATOMICS__ -D__STDC_NO_VLA__ -isystem /Users/Michel/Library/Arduino15/packages/Z-Uno/tools/zuno_toolchain/00.08.10/zuno_toolchain/sdcc//bin/../share/sdcc/include/mcs51 -isystem /usr/local/share/sdcc/include/mcs51 -isystem /Users/Michel/Library/Arduino15/packages/Z-Uno/tools/zuno_toolchain/00.08.10/zuno_toolchain/sdcc//bin/../share/sdcc/include -isystem /usr/local/share/sdcc/include /var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/LLCore_arduino.c
sdcc: Generating code...
/var/folders/h8/rk4jqb61489clkyncw9s2ppm0000gn/T/build3283161571940803437.tmp/Custom.h:16: syntax error: token -> '{' ; column 198
Error. SDCC returned: 1
Error compiling.
Thanks a lot
Greg