CaryCoders
/
demo_SX1276_standalone
standalone sx1276 demo program
Fork of SX1276_GPS by
Diff: main.cpp
- Revision:
- 7:d087e901b74b
- Parent:
- 6:a6be2aede8f2
- Child:
- 9:1501fb01ded6
diff -r a6be2aede8f2 -r d087e901b74b main.cpp --- a/main.cpp Sat Aug 02 16:05:40 2014 +0000 +++ b/main.cpp Sun Aug 03 15:14:56 2014 +0000 @@ -6,7 +6,7 @@ Serial pc(SERIAL_TX, SERIAL_RX); MCP23017 mcp23017 = MCP23017(I2C_SDA, I2C_SCL, 0x40); -Adafruit_RGBLCDShield lcd(mcp23017,pc); +Adafruit_RGBLCDShield lcd(mcp23017); // Allows to set the backlight, if the LCD backpack is used void SetBacklight(unsigned char status) @@ -20,19 +20,14 @@ void loop() { - // set the cursor to column 0, line 1 - // (note: line 1 is the second row, since counting begins with 0): - lcd.setCursor(10, 1); + static int count = 0; - //lcd.cursor(); - //lcd.blink(); - uint8_t buttons = lcd.readButtons(); - - lcd.setBacklight(buttons ? 1 : 0); - + if (buttons) { + count = 0; + lcd.clear(); lcd.setCursor(0,0); @@ -71,25 +66,19 @@ lcd.printf("SELECT "); } } - - lcd.setCursor(0,0); - lcd._putc('A'); - - lcd.display(); + else + { + lcd.setCursor(0,1); + lcd.printf("Waiting... %i",count++); + } } int main() { - pc.printf("\n\rSTART\n\r"); - - // Take MCP out of reset to show its backlight - //pc.printf("mcp23017.config(0,1,0);\n\r"); - //mcp23017.config(0,1,0); - //wait(0.5); - pc.printf("\n\rInitialise LCD\n\r"); lcd.begin(16,2); - + + lcd.printf("AdaFruit RGB LCD Shield"); pc.printf("\n\rEntering key tracking loop\n\r"); while (true) {