CaryCoders
/
demo_SX1276_standalone
standalone sx1276 demo program
Fork of SX1276_GPS by
main.cpp@28:fbcd3bac0cd7, 2014-10-10 (annotated)
- Committer:
- vtraveller
- Date:
- Fri Oct 10 11:10:56 2014 +0000
- Revision:
- 28:fbcd3bac0cd7
- Parent:
- 27:b6c3dd9a1d8c
- Child:
- 29:0ea07cc7124b
Reduced write delay - faster LCD response
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wim | 0:88d87b1c1f8b | 1 | #include "mbed.h" |
vtraveller | 13:9641bc42db92 | 2 | |
vtraveller | 25:24654d08a99a | 3 | #include "lcdadafruit.h" |
vtraveller | 25:24654d08a99a | 4 | #include "lcd2004.h" |
vtraveller | 26:0cfd95d8f270 | 5 | #include "keyreaderadafruit.h" |
vtraveller | 25:24654d08a99a | 6 | #include "keyreadernull.h" |
vtraveller | 10:3fcab08717fc | 7 | #include "RTclock.h" |
vtraveller | 10:3fcab08717fc | 8 | |
vtraveller | 10:3fcab08717fc | 9 | #include "DateModule.h" |
vtraveller | 10:3fcab08717fc | 10 | #include "TempModule.h" |
vtraveller | 10:3fcab08717fc | 11 | #include "TimeModule.h" |
vtraveller | 10:3fcab08717fc | 12 | #include "TitleModule.h" |
vtraveller | 17:731a47339cb8 | 13 | #include "SyncModule.h" |
wim | 0:88d87b1c1f8b | 14 | |
vtraveller | 13:9641bc42db92 | 15 | #include "MenuManager.h" |
vtraveller | 10:3fcab08717fc | 16 | |
vtraveller | 3:ed09f95739df | 17 | int main() |
vtraveller | 21:c44cfd3259c0 | 18 | { |
vtraveller | 21:c44cfd3259c0 | 19 | // Share the I2C across multiple devices |
vtraveller | 21:c44cfd3259c0 | 20 | I2C cI2C(I2C_SDA, I2C_SCL); // D3, D6 |
vtraveller | 21:c44cfd3259c0 | 21 | cI2C.frequency(400000); // I2C can handle two different frequencies - switch to high speed if asked |
vtraveller | 25:24654d08a99a | 22 | |
vtraveller | 28:fbcd3bac0cd7 | 23 | //LCDadafruit cLCD(cI2C); |
vtraveller | 28:fbcd3bac0cd7 | 24 | LCD2004 cLCD(cI2C); |
vtraveller | 26:0cfd95d8f270 | 25 | //KeyReaderNull cKeys(cI2C); |
vtraveller | 26:0cfd95d8f270 | 26 | KeyReaderAdafruit cKeys(cI2C); |
vtraveller | 20:93c70a1869ee | 27 | |
vtraveller | 23:94d2f0d62247 | 28 | RTclock cClock(cI2C, 0x68 << 1, RTclock::eDS3231); |
vtraveller | 13:9641bc42db92 | 29 | |
vtraveller | 13:9641bc42db92 | 30 | // Spin up RTC |
vtraveller | 19:72c02acb601d | 31 | cClock.mapTime(); |
vtraveller | 17:731a47339cb8 | 32 | |
vtraveller | 10:3fcab08717fc | 33 | // Set up display modules |
vtraveller | 10:3fcab08717fc | 34 | Module * aModules[] = |
vtraveller | 10:3fcab08717fc | 35 | { |
vtraveller | 25:24654d08a99a | 36 | new TitleModule(cLCD,cClock), |
vtraveller | 22:dd8197db4478 | 37 | new TempModule(cLCD,cI2C,0x18 << 1), |
vtraveller | 17:731a47339cb8 | 38 | new TimeModule(cLCD,cClock), |
vtraveller | 20:93c70a1869ee | 39 | new DateModule(cLCD,cClock), |
vtraveller | 19:72c02acb601d | 40 | new SyncModule(cLCD,cClock), |
vtraveller | 10:3fcab08717fc | 41 | }; |
vtraveller | 10:3fcab08717fc | 42 | |
vtraveller | 13:9641bc42db92 | 43 | // Set up the menu manager |
vtraveller | 25:24654d08a99a | 44 | // MenuManager cMenuManager(aModules,_countof(aModules),cLCD,cKeys,16,2); |
vtraveller | 25:24654d08a99a | 45 | MenuManager cMenuManager(aModules,_countof(aModules),cLCD,cKeys); |
vtraveller | 13:9641bc42db92 | 46 | |
vtraveller | 13:9641bc42db92 | 47 | // Start menu manager loop |
vtraveller | 13:9641bc42db92 | 48 | cMenuManager.loop(); |
wim | 0:88d87b1c1f8b | 49 | } |