I am trying to use a code that compiled fine on the ATTINY, but not on the Z-uno..
When verifying it sais interrupt.h is missing. I am using the library SoftwareSerial.h
Also, if I upload something that dont use this library it works. So I am guessing the library is the problem. I've also added the lib in the roming folder.
My code;
Code: Select all
//
//Mailbox reciver
#include <SoftwareSerial.h>
SoftwareSerial mySerial(6, 7); // RX, TX
int mail = 2;
int lowBatt = 3;
int lock = 5;
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
pinMode(mail, OUTPUT);
pinMode(lowBatt, OUTPUT);
pinMode(lock, INPUT);
}
void loop() {
if(mySerial.available() > 1){
int input = mySerial.parseInt();//read serial input and convert to integer (-32,768 to 32,767)
//
//Mail recived one lid mode
//
if(input == 1478){//One lid mode and mailbox lid open
digitalWrite(mail, HIGH);//Notify of recived mail
}
if(input == 1479){//One lid mode and mailbox lid closed
digitalWrite(mail, LOW);//keep pin off
}
//
//Mail recived two lid mode
//
if(input == 2468){//Mail recived, two lid mode
digitalWrite(mail, HIGH);//Notify of recived mail
}
if(input == 2469){//Admin lid has not been opened
digitalWrite(mail, LOW);//keep pin off
}
//
//Low battery
//
if(input == 1234){//LOW BATT code
digitalWrite(lowBatt, HIGH);//notify for low batt
}
if(input == 1235){//BATT OK code
digitalWrite(lowBatt, LOW);//keep pin off
}
}
//
//FIBARO send unlcok signal
//
if(lock == 1){//if FIBARO want to unlock
mySerial.println(1236);//Send code for unlock
}
delay(20);
if(lock == 0 ){//if lock pin is LOW
mySerial.println(1237);//Send code to keep lock pin low
}
delay(20);
mySerial.flush();//clear the serial buffer for unwanted inputs
delay(20);//delay little for better serial communication
}
Also, I have not added anything for the Z-wave network yet. I am trying to get my code to work with the Z-uno first. I am using HC-12 modules for wireless serial.