standalone sx1276 demo program

Dependencies:   SX1276Lib mbed

Fork of SX1276_GPS by CaryCoders

Revision:
21:c44cfd3259c0
Parent:
20:93c70a1869ee
Child:
22:dd8197db4478
diff -r 93c70a1869ee -r c44cfd3259c0 main.cpp
--- a/main.cpp	Sat Aug 30 16:30:27 2014 +0000
+++ b/main.cpp	Tue Sep 02 07:12:23 2014 +0000
@@ -14,15 +14,18 @@
 //Serial cPC(SERIAL_TX, SERIAL_RX);
 
 int main()
-{    
-    MCP23017 cMCP23017 = MCP23017(I2C_SDA, I2C_SCL, 0x40, true);
-    //MCP23017 cMCP23017 = MCP23017(I2C_SDA, I2C_SCL, 0x4E, true);
+{
+    // Share the I2C across multiple devices
+    I2C cI2C(I2C_SDA, I2C_SCL);    // D3, D6
+    cI2C.frequency(400000);    // I2C can handle two different frequencies - switch to high speed if asked
+    
+    MCP23017 cMCP23017(cI2C, 0x40);
+    //MCP23017 cMCP23017(cI2C, 0x4E, true);
     
     Adafruit_RGBLCDShield cLCD(cMCP23017);
     //Adafruit_RGBLCDShield cLCD(cMCP23017,1<<0,1<<1, 1<< 2, 1<<4, 1<<5, 1<<6, 1<<7);
     
-    RTclock cClock(I2C_SDA, I2C_SCL, RTclock::eDS3231);
-    //RTclock cClock(D3, D6);
+    RTclock cClock(cI2C, RTclock::eDS3231);
 
     // Spin up RTC
     cClock.mapTime();
@@ -30,7 +33,7 @@
     // Set up display modules    
     Module * aModules[] =
     {
-        new TempModule(cLCD),
+        new TempModule(cLCD,cI2C,0x18),
         new TimeModule(cLCD,cClock),
         new DateModule(cLCD,cClock),        
         new SyncModule(cLCD,cClock),