Hello everyone. I am making an arduino program that responds to raceiver input, then displays on the LCD. The problem is, even when I don't have the transceiver hooked up, the lcd just scrolls through gibberish. Random characters etc. Here is my code, can anyone help me?
//Libraries
#include <SPI.h>
#include <Servo.h>
#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>
#include <LiquidCrystal.h>
RF24 radio(8, 9); // CE, CSN
const byte addresses[][6] = {"00001", "00002"};
const int rs = 7, en = 6, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int button = 10;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(button, INPUT);
radio.begin();
radio.openWritingPipe(addresses[0]); // 00002
radio.openReadingPipe(1, addresses[1]); // 00001
radio.setPALevel(RF24_PA_MIN);
lcd.begin(16, 2);
}
void loop() {
if(digitalRead(button) == LOW){
radio.stopListening();
lcd.setCursor(0,0) ;
lcd.print("EMERGENCY");
lcd.setCursor(0,1);
lcd.print("OFFICE");
Serial.print("EMGERGENCY");
}
else{
radio.stopListening();
lcd.setCursor(0,0) ;
lcd.print("ALL");
lcd.setCursor(0,1);
lcd.print("CLEAR");
Serial.print("Clear");
}
}