![](/media/cache/group/NimbeLink_Logo.png.50x50_q85.png)
Release 1.0 supporting the Kinetis Freedom K64F board and NimbeLink NL-AB-ST-NCL and NimbeLink NL-SWSK. Tested with NL-SW-1xRTT-V and NL-SW-EVDO-V modems.
Dependencies: LIS3DH LM75B LPS331 mbed hts221
Getting Started Guide
Note for the NL-AB-ST-NCL: In order to use the NimbeLink NL-AB-ST-NCL with the NXP FRDM-K64F, you must populate Resistors R2 and R8 while removing resistors R1 and R7. The NimbeLink NL-AB-ST-NCL will not work with the FRDM-K64F unless this change is made.
Note for the NL-SWSK: In order to use the NimbeLink NL-SWSK with the NXP FRDM-K64F, you must move Jumpers J3 and J4 to pins 2 and 3. The NimbeLink NL-SWSK will not work with the FRDM-K64F unless this change is made.
- Place the Skywire Shield onto the FRDM-K64F as pictured
- Place the Skywire modem onto the Shield as picture and attach the antenna U.FL coax cable as pictured
- Screw in the antenna
- Plug the 12V wall supply into the Skywire Shield
- For serial debugging, plug a micro-USB cable into port J26 of the FRDM-K64F. If you are using Windows, make sure you have the serial drivers installed-please consult the guide at https://developer.mbed.org/handbook/Windows-serial-configuration for installation.Use a terminal emulation program such as TeraTerm with the following settings:
- Baud Rate: 115200
- Data: 8 bit
- Parity: none
- Stop: 1 bit
- Flow Control: none
- Go to https://freeboard.io/ and create a user account
- Once you are logged into your Freeboard account, go to https://freeboard.io/board/LhnbrX and clone the dashboard by clicking the CLONE link in the lower right corner
- Old revision of dashboard is available here: https://freeboard.io/board/jqlneI
- Old revision of dashboard is available here: https://freeboard.io/board/jqlneI
- The new dashboard will show up on you account list under My Freeboards, you can then edit the name to whatever you like
- Under the Datasources tab on the dashboard, click the skywire link
- Change the THING NAME field to the MEID of the Skywire Modem. The MEID is printed on top of the modem. Otherwise, you can get the MEID from the serial output.
- Next Import the Skywire_Kinetis_K64_demo program into the online compiler
- Compile and upload to the FRDM-K64F, cycle power to the shield and the sensor data should start to upload to your new Freeboard.
Diff: main.cpp
- Revision:
- 1:e05da6207ebb
- Parent:
- 0:a096c02fb1b0
--- a/main.cpp Wed Jun 24 17:49:02 2015 +0000 +++ b/main.cpp Wed Aug 12 15:55:43 2015 +0000 @@ -1,8 +1,28 @@ +/* main.cpp */ +/* v1.1 + * Copyright (C) 2015 nimbelink.com, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + #include "mbed.h" #include "LPS331.h" #include "LIS3DH.h" #include "LM75B.h" - +#include "hts221.h" // #define DeviceID "A100003E4226B3" //Freeboard DweetIO unique ID // dynamically assigning this based on modem's unique identifier below @@ -13,8 +33,6 @@ DigitalOut skywire_rts(PTD2); //K64 FRDM DigitalOut skywire_dtr(PTD0); //K64 FRDM - - DigitalOut led_red(LED_RED); DigitalOut led_green(LED_GREEN); DigitalIn sw2(SW2); @@ -28,13 +46,10 @@ LPS331 pressure(i2c); LM75B LM75_temp(PTE25,PTE24); LIS3DH accel(i2c, LIS3DH_V_CHIP_ADDR, LIS3DH_DR_NR_LP_100HZ, LIS3DH_FS_2G); - +HTS221 humidity(PTE25, PTE24); char str[255]; - - - float latitude; float longitude; int number; @@ -169,7 +184,9 @@ led_green = 1; float axis[3]; float press; - float temp; + float temp; + float humi; + float dummy_temp; // turn on Skywire modem skywire_en = 1; @@ -234,11 +251,13 @@ wait(3); while(1) { - temp = (float)LM75_temp; - temp = temp *9 /5 + 32; + temp = (float)LM75_temp; + temp = temp *9 /5 + 32; pc.printf("Temp = %.3f\r\n", temp); - press=(float)pressure.value() / 4096; + press=(float)pressure.value() / 4096; pc.printf("Pressure = %.3f\r\n", press); + humidity.ReadTempHumi(&dummy_temp, &humi); + pc.printf("Humidity = %.3f\r\n", humi); accel.read_data(axis); pc.printf("Accel = %.3f, %.3f, %.3f\r\n", axis[0], axis[1], axis[2]); @@ -246,10 +265,9 @@ // turn LED Green to indicate transmission led_red=1; led_green = 0; - //Report Sensor Data to dweet.io - skywire.printf("AT#HTTPQRY=1,0,\"/dweet/for/%s?temperature=%.3f&pressure=%.3f&X=%.3f&Y=%.3f&Z=%.3f&Latitude=%f&Longitude=%f\"\r\n", DeviceID, temp, press, axis[0], axis[1], axis[2], latitude, longitude); + skywire.printf("AT#HTTPQRY=1,0,\"/dweet/for/%s?temp=%.3f&press=%.3f&humi=%.3f&X=%.3f&Y=%.3f&Z=%.3f&Latitude=%f&Longitude=%f\"\r\n", DeviceID, temp, press, humi, axis[0], axis[1], axis[2], latitude, longitude); WaitForResponse("#HTTPRING", 9); skywire.printf("AT#HTTPRCV=1\r\n"); WaitForResponse("OK", 2);