void setup() {
...
pinMode(CS_WIFI,OUTPUT);
pinMode(CS_LCD,OUTPUT);
digitalWrite(CS_LCD,HIGH);
lcd.init(PHILLIPS); // Initializes lcd, using an EPSON driver
lcd.contrast(80); // 40's usually a good contrast value
lcd.clear(RED); // oooh, teal!
WiFly.begin();
WiFly.setIdleDisconnect();
if (!WiFly.join(ssid, passphrase)) {
Serial.println("Association failed.");
while (1) {
// Hang on failure.
}
}
// give the Wifi shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect()) {
Serial.println("connected");
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
...
}
void loop() {
//When I catch the char V from the serial call the function => requestQRCODE
}
void requestQRCODE() {
noInterrupts();
digitalWrite(10,HIGH);
digitalWrite(9,LOW);
lcd.init(PHILLIPS);
digitalWrite(10,HIGH);
digitalWrite(9,LOW);
lcd.contrast(10); // 40's usually a good contrast value
lcd.clear(RED);
// do your lcd draw
// then disable the lcd and enable the WiFly
digitalWrite(9,HIGH);
digitalWrite(10,LOW);
interrupts();
}
I tried to remove the init into the requestQRCODE but still doesn't work