Dreamforce Heroku Sample mbed application for the FRDM-K64F. This application uses SocketIO to connect and communicate with Heroku.

Dependencies:   BufferedSerial C12832 EthernetInterface HTTPClient-SSL LM75B MMA7660 SocketIO-k64f WebSocketClient-ThermostatDemo mbed-rtos mbed picojson

Fork of df-2013-minihack-thermostat-complete by MBED_DEMOS

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Thu Oct 09 16:14:18 2014 +0000
Parent:
5:3ab657317bfa
Commit message:
updates of the 2013 DF heroku app ported to K64F+appshield

Changed in this revision

BufferedSerial.lib Show annotated file Show diff for this revision Revisions of this file
C12832.lib Show annotated file Show diff for this revision Revisions of this file
C12832_lcd.lib Show diff for this revision Revisions of this file
EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
HTTPClient-SSL.lib Show annotated file Show diff for this revision Revisions of this file
HTTPClient.lib Show diff for this revision Revisions of this file
MMA7660.lib Show annotated file Show diff for this revision Revisions of this file
README.txt Show annotated file Show diff for this revision Revisions of this file
SocketIO.lib Show annotated file Show diff for this revision Revisions of this file
Thermostat-BaseUtils.h Show annotated file Show diff for this revision Revisions of this file
Thermostat-LEDUtils.h Show annotated file Show diff for this revision Revisions of this file
Thermostat.cpp Show annotated file Show diff for this revision Revisions of this file
Thermostat.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 3ab657317bfa -r 74c1e9c8c90e BufferedSerial.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BufferedSerial.lib	Thu Oct 09 16:14:18 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/sam_grove/code/BufferedSerial/#8287e83943f0
diff -r 3ab657317bfa -r 74c1e9c8c90e C12832.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832.lib	Thu Oct 09 16:14:18 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/components/code/C12832/#03069e3deaa4
diff -r 3ab657317bfa -r 74c1e9c8c90e C12832_lcd.lib
--- a/C12832_lcd.lib	Mon Nov 11 20:35:49 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/dreschpe/code/C12832_lcd/#c9afe58d786a
diff -r 3ab657317bfa -r 74c1e9c8c90e EthernetInterface.lib
--- a/EthernetInterface.lib	Mon Nov 11 20:35:49 2013 +0000
+++ b/EthernetInterface.lib	Thu Oct 09 16:14:18 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/ansond/code/EthernetInterface-ansond-patched/#74b36d01b352
+http://mbed.org/users/mbed_official/code/EthernetInterface/#5887ae6c0c2c
diff -r 3ab657317bfa -r 74c1e9c8c90e HTTPClient-SSL.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient-SSL.lib	Thu Oct 09 16:14:18 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/ansond/code/HTTPClient-SSL/#7cd69cc809b8
diff -r 3ab657317bfa -r 74c1e9c8c90e HTTPClient.lib
--- a/HTTPClient.lib	Mon Nov 11 20:35:49 2013 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/ansond/code/HTTPClient-thermostat-remotes/#56ed7ad985da
diff -r 3ab657317bfa -r 74c1e9c8c90e MMA7660.lib
--- a/MMA7660.lib	Mon Nov 11 20:35:49 2013 +0000
+++ b/MMA7660.lib	Thu Oct 09 16:14:18 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/Sissors/code/MMA7660/#a8e20db7901e
+http://mbed.org/users/Sissors/code/MMA7660/#36a163511e34
diff -r 3ab657317bfa -r 74c1e9c8c90e README.txt
--- a/README.txt	Mon Nov 11 20:35:49 2013 +0000
+++ b/README.txt	Thu Oct 09 16:14:18 2014 +0000
@@ -3,8 +3,8 @@
 1). Complete the “hands-on” exercises first
     - Required to get setup with an mbed account and the compiler environment
 
-2). Import the “df-2013-minihack-thermostat” project into your mbed project workspace
-    - Be sure to add and make current the “mbed LPC1768” board as the current board 
+2). Import the “df-2013-minihack-thermostat-k64f” project into your mbed project workspace
+    - Be sure to add and make current the “FRDM-K64F” board as the current board 
       to compile to. You can modify the GPS coords and devie name in the same manner
       that you did in the hands-on session - this will enable you to quickly and easily
       identify your device on the map
@@ -23,3 +23,6 @@
 References:
     - Project Source:  http://mbed.org/teams/MBED_DEMOS/code/df-2013-minihack-thermostat/ 
     - Completed Code: http://mbed.org/teams/MBED_DEMOS/code/df-2013-minihack-thermostat-complete/ 
+    
+To View Connected Devices
+    - http://mc-control-1.herokuapp.com (username: <blank> password: foobar)
diff -r 3ab657317bfa -r 74c1e9c8c90e SocketIO.lib
--- a/SocketIO.lib	Mon Nov 11 20:35:49 2013 +0000
+++ b/SocketIO.lib	Thu Oct 09 16:14:18 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/ansond/code/SocketIO/#b32005b69b5c
+http://developer.mbed.org/users/ansond/code/SocketIO-k64f/#1b8ff174aea6
diff -r 3ab657317bfa -r 74c1e9c8c90e Thermostat-BaseUtils.h
--- a/Thermostat-BaseUtils.h	Mon Nov 11 20:35:49 2013 +0000
+++ b/Thermostat-BaseUtils.h	Thu Oct 09 16:14:18 2014 +0000
@@ -21,11 +21,12 @@
 #define THERMOSTAT_BASEUTILS_H_
 
 // AppBoard LCD Support
-#include "C12832_lcd.h"
-C12832_LCD lcd;
+#include "C12832.h"
+C12832 lcd(D11, D13, D12, D7, D10);
 
 // Serial Console Support (main.cpp)
-extern Serial pc;
+#include "BufferedSerial.h"
+extern BufferedSerial pc;
 
 // log messages to appropriate outputs
 void Thermostat::logMessage(bool do_lcd) {    
diff -r 3ab657317bfa -r 74c1e9c8c90e Thermostat-LEDUtils.h
--- a/Thermostat-LEDUtils.h	Mon Nov 11 20:35:49 2013 +0000
+++ b/Thermostat-LEDUtils.h	Thu Oct 09 16:14:18 2014 +0000
@@ -23,23 +23,23 @@
 // LEDs to toggle with control messages
 DigitalOut led1(LED1);
 DigitalOut led2(LED2);
-DigitalOut led3(LED3);
-DigitalOut led4(LED4);
+DigitalOut led3(LED1);
+DigitalOut led4(LED2);
 
 // Joystick button (to create an error condition)
-DigitalIn joystick_pressed(p14);
-DigitalIn joystick(p15);        
+DigitalIn joystick_pressed(A2);
+DigitalIn joystick(A3);        
 
 // Pot 1 for dialing up and down the temperature
-AnalogIn Pot1(p19);
+AnalogIn Pot1(A0);
 
 // Pot 2 for dialing up and down the battery level
-AnalogIn Pot2(p20);
+AnalogIn Pot2(A1);
 
 // the led's are connected to vcc, so a PwmOut of 100% will shut off the led and 0% will let it shine
-PwmOut r (p23);
-PwmOut g (p24);
-PwmOut b (p25);
+PwmOut r (D5);
+PwmOut g (D8);
+PwmOut b (D9);
 
 // get the int value of the joystick state
 int Thermostat::getErrorState() {
diff -r 3ab657317bfa -r 74c1e9c8c90e Thermostat.cpp
--- a/Thermostat.cpp	Mon Nov 11 20:35:49 2013 +0000
+++ b/Thermostat.cpp	Thu Oct 09 16:14:18 2014 +0000
@@ -67,13 +67,13 @@
 // Accelerometer Support
 //
 #include "MMA7660.h"
-MMA7660 acc(p28, p27);
+MMA7660 acc(D14,D15);
 
 //
 // Temperature Sensor Support
 //
 #include "LM75B.h"
-LM75B temp_sensor(p28,p27);
+LM75B temp_sensor(D14,D15);
 
 //
 // Ethernet support
@@ -312,11 +312,7 @@
     if (ethernet.connect() == 0) connected = true;
     
     // check connection status
-    if (connected) {
-        ipAddr = ethernet.getIPAddress();
-        if (ipAddr != NULL && strlen(ipAddr) > 0)
-            connected = true;
-    }
+    if (connected) ipAddr = ethernet.getIPAddress();
    
     // log 
     if (connected == true) {
diff -r 3ab657317bfa -r 74c1e9c8c90e Thermostat.h
--- a/Thermostat.h	Mon Nov 11 20:35:49 2013 +0000
+++ b/Thermostat.h	Thu Oct 09 16:14:18 2014 +0000
@@ -27,7 +27,7 @@
 #include <stdarg.h>
 
 // maximum size of a displayed message
-#define MAX_MESSAGE_LENGTH  100
+#define MAX_MESSAGE_LENGTH  256
 
 class Thermostat {
     public:
diff -r 3ab657317bfa -r 74c1e9c8c90e main.cpp
--- a/main.cpp	Mon Nov 11 20:35:49 2013 +0000
+++ b/main.cpp	Thu Oct 09 16:14:18 2014 +0000
@@ -2,7 +2,8 @@
 
 #include "Thermostat.h"
 
-Serial pc(USBTX, USBRX);
+#include "BufferedSerial.h"
+BufferedSerial pc(USBTX, USBRX);
 Thermostat *thermostat = NULL;
 
 // check for exit
diff -r 3ab657317bfa -r 74c1e9c8c90e mbed-rtos.lib
--- a/mbed-rtos.lib	Mon Nov 11 20:35:49 2013 +0000
+++ b/mbed-rtos.lib	Thu Oct 09 16:14:18 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#ee87e782d34f
+http://mbed.org/users/mbed_official/code/mbed-rtos/#631c0f1008c3
diff -r 3ab657317bfa -r 74c1e9c8c90e mbed.bld
--- a/mbed.bld	Mon Nov 11 20:35:49 2013 +0000
+++ b/mbed.bld	Thu Oct 09 16:14:18 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file