mbed application board program with most libraries pulled in to create a feature rich starting point for hackathons
Dependencies: C12832_lcd EthernetInterface HTTPClient LM75B MMA7660 mbed-rtos mbed
Fork of HTTPClient_HelloWorld by
AT&T M2M Mobile App Hackathon
- DFW 09-14 & 09-15
- Attendee List
- API Details
- Winning team pitches idea to ATT Executives on Tuesday 09-17-2013
Team's Project Pitch Notes
- Car location and tracking system (GPS + Wifi + Cellular)
- Temperature / auto vent control for home and industrial use (cellular + servo)
- GPS triangulation (sonar + cellular)
- Emergency Tool (Low cost OnStar / Sync Emergency Assistance)
- Remote Video Conference: Tele-presense (cellular and buttons. Rest was web services)
- M2M Billboard (LED + Cellular)
- Order management (restaurants) - Interrupt driven service. Not polled by wait staff (level sensor and cellular)
- pool manager (simulated ph and chem readings -> cellular)
- sprest - learning electronic sprinkler system (simulated moisture and weather readings -> cellular)
- safe traffic signals: stoprite (lots of statistics, used buttons and toy cars to create a scenario)
- Ecosense
Keywords Used Frequently During Presentation
- real-time
- MQTT
- Arduino
- 2lemetry
- HTML5
- Big data
- Server side
Participants
- ARM mbed
- low use. No wifly modules and little/no wired Ethernet
- ATT Github page with arduino stuff
- 2lemetry
- MSFT
- One group hacked on windows phone, rest on android / iphone
- Most were HTML5 (better looking ones)
Pictures from the Event
main.cpp@4:1ec9d1243e8b, 2013-09-15 (annotated)
- Committer:
- atthackathon
- Date:
- Sun Sep 15 16:42:31 2013 +0000
- Revision:
- 4:1ec9d1243e8b
- Parent:
- 3:71cb394cbb32
- Child:
- 5:83c272535884
added HTTP support
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 0:0e0debc29569 | 1 | #include "mbed.h" |
atthackathon | 3:71cb394cbb32 | 2 | |
atthackathon | 3:71cb394cbb32 | 3 | // Ethernet |
donatien | 0:0e0debc29569 | 4 | #include "EthernetInterface.h" |
donatien | 0:0e0debc29569 | 5 | #include "HTTPClient.h" |
donatien | 1:d263603373ac | 6 | EthernetInterface eth; |
donatien | 1:d263603373ac | 7 | HTTPClient http; |
donatien | 1:d263603373ac | 8 | char str[512]; |
donatien | 1:d263603373ac | 9 | |
atthackathon | 3:71cb394cbb32 | 10 | //LCD |
atthackathon | 3:71cb394cbb32 | 11 | #include "C12832_lcd.h" |
atthackathon | 3:71cb394cbb32 | 12 | C12832_LCD lcd; |
atthackathon | 3:71cb394cbb32 | 13 | |
atthackathon | 3:71cb394cbb32 | 14 | // joystick pins and LED |
atthackathon | 3:71cb394cbb32 | 15 | BusIn joystick(p15,p12,p13,p16); |
atthackathon | 3:71cb394cbb32 | 16 | DigitalIn enter(p14); |
atthackathon | 3:71cb394cbb32 | 17 | BusOut led(LED1,LED2,LED3,LED4); |
atthackathon | 3:71cb394cbb32 | 18 | Ticker joystick_to_led; |
atthackathon | 4:1ec9d1243e8b | 19 | void joystickHandler(void) |
atthackathon | 4:1ec9d1243e8b | 20 | { |
atthackathon | 4:1ec9d1243e8b | 21 | led = (enter) ? 0xf : joystick; |
atthackathon | 4:1ec9d1243e8b | 22 | } |
atthackathon | 3:71cb394cbb32 | 23 | |
atthackathon | 3:71cb394cbb32 | 24 | // Accelerometer |
atthackathon | 3:71cb394cbb32 | 25 | #include "MMA7660.h" |
atthackathon | 3:71cb394cbb32 | 26 | MMA7660 accelerometer(p28, p27); |
atthackathon | 3:71cb394cbb32 | 27 | |
atthackathon | 3:71cb394cbb32 | 28 | // RGB LED |
atthackathon | 3:71cb394cbb32 | 29 | PwmOut r(p23); |
atthackathon | 3:71cb394cbb32 | 30 | PwmOut g(p24); |
atthackathon | 3:71cb394cbb32 | 31 | PwmOut b(p25); |
atthackathon | 3:71cb394cbb32 | 32 | |
atthackathon | 3:71cb394cbb32 | 33 | // Temp sensor |
atthackathon | 3:71cb394cbb32 | 34 | #include "LM75B.h" |
atthackathon | 3:71cb394cbb32 | 35 | LM75B temp(p28,p27); |
atthackathon | 3:71cb394cbb32 | 36 | |
atthackathon | 4:1ec9d1243e8b | 37 | //char const *URL = "http://mbed.org/media/uploads/donatien/hello.txt"; |
atthackathon | 4:1ec9d1243e8b | 38 | char const *URL = "http://mbed.org/"; |
atthackathon | 4:1ec9d1243e8b | 39 | |
atthackathon | 3:71cb394cbb32 | 40 | int main() |
donatien | 0:0e0debc29569 | 41 | { |
atthackathon | 4:1ec9d1243e8b | 42 | r = g = b = 1.0f; |
atthackathon | 4:1ec9d1243e8b | 43 | joystick_to_led.attach(&joystickHandler, 0.001f); |
atthackathon | 3:71cb394cbb32 | 44 | lcd.printf ("Bootstrap Complete!\n"); |
atthackathon | 4:1ec9d1243e8b | 45 | |
atthackathon | 3:71cb394cbb32 | 46 | // Prepare to use DHCP |
atthackathon | 4:1ec9d1243e8b | 47 | if (0 != eth.init()) { |
atthackathon | 3:71cb394cbb32 | 48 | error("Init Failed\n"); |
atthackathon | 3:71cb394cbb32 | 49 | } |
atthackathon | 3:71cb394cbb32 | 50 | // Try to get an IPAddress |
atthackathon | 4:1ec9d1243e8b | 51 | if (0 != eth.connect()) { |
atthackathon | 4:1ec9d1243e8b | 52 | //error("Connect Failed:\n"); |
atthackathon | 3:71cb394cbb32 | 53 | } |
atthackathon | 3:71cb394cbb32 | 54 | // Now we are part of the network |
atthackathon | 3:71cb394cbb32 | 55 | printf("IP Address: %s\n", eth.getIPAddress()); |
donatien | 0:0e0debc29569 | 56 | //GET data |
atthackathon | 4:1ec9d1243e8b | 57 | printf("\nTrying to fetch page %s\n", URL); |
atthackathon | 4:1ec9d1243e8b | 58 | if(!http.get(URL, str, 512)) { |
atthackathon | 3:71cb394cbb32 | 59 | printf("Page fetched successfully - read %d characters\n", strlen(str)); |
atthackathon | 3:71cb394cbb32 | 60 | printf("Result: %s\n", str); |
atthackathon | 3:71cb394cbb32 | 61 | } else { |
atthackathon | 4:1ec9d1243e8b | 62 | printf("Error - HTTP return code = %d\n", http.getHTTPResponseCode()); |
donatien | 0:0e0debc29569 | 63 | } |
atthackathon | 3:71cb394cbb32 | 64 | eth.disconnect(); |
donatien | 0:0e0debc29569 | 65 | |
donatien | 0:0e0debc29569 | 66 | while(1) { |
atthackathon | 4:1ec9d1243e8b | 67 | lcd.locate(8,10); |
atthackathon | 4:1ec9d1243e8b | 68 | //lcd.printf("Temp: %.1fC", temp.read()); |
atthackathon | 4:1ec9d1243e8b | 69 | lcd.printf("Temp: %.1fF", (temp.read()+32*(9/5))); |
atthackathon | 4:1ec9d1243e8b | 70 | |
atthackathon | 4:1ec9d1243e8b | 71 | lcd.locate(8,20); |
atthackathon | 4:1ec9d1243e8b | 72 | lcd.printf("X: %.1f Y:%.1f Z:%.1f\n", accelerometer.x(), accelerometer.y(), accelerometer.z()); |
atthackathon | 4:1ec9d1243e8b | 73 | |
atthackathon | 4:1ec9d1243e8b | 74 | r = 1.0f - accelerometer.x(); |
atthackathon | 4:1ec9d1243e8b | 75 | g = 1.0f - accelerometer.y(); |
atthackathon | 4:1ec9d1243e8b | 76 | b = 1.0f - accelerometer.z(); |
atthackathon | 4:1ec9d1243e8b | 77 | |
atthackathon | 4:1ec9d1243e8b | 78 | led = (enter) ? 0xf : joystick; |
donatien | 0:0e0debc29569 | 79 | } |
donatien | 0:0e0debc29569 | 80 | } |