Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of 2645_I2C_TMP102 by
Revision 2:5d19af7385a0, committed 2018-05-22
- Comitter:
- labviewdxp
- Date:
- Tue May 22 07:15:52 2018 +0000
- Parent:
- 1:dd5fb735acf1
- Commit message:
- for export;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r dd5fb735acf1 -r 5d19af7385a0 main.cpp --- a/main.cpp Fri Feb 05 17:25:03 2016 +0000 +++ b/main.cpp Tue May 22 07:15:52 2018 +0000 @@ -20,24 +20,20 @@ Serial pc(USBTX,USBRX); // K64F on-board LEDs -DigitalOut r_led(LED_RED); -DigitalOut g_led(LED_GREEN); -DigitalOut b_led(LED_BLUE); -// K64F on-board switches -InterruptIn sw2(SW2); -InterruptIn sw3(SW3); +//DigitalOut r_led(LED_RED); + // error function hangs flashing an LED void error(); // setup serial port void init_serial(); // set-up the on-board LEDs and switches -void init_K64F(); +//void init_K64F(); int main() { // initialise the board and serial port - init_K64F(); + //init_K64F(); init_serial(); // call the sensor init method using dot syntax tmp102.init(); @@ -46,9 +42,9 @@ // read temperature and print over serial port float T = tmp102.get_temperature(); - pc.printf("T = %f K\n",T); + pc.printf("T = %f C",T); // small delay - 1s to match the update rate of the sensor (1 Hz) - wait(1.0); + //wait(1); } @@ -56,19 +52,7 @@ void init_serial() { // set to highest baud - ensure terminal software matches - pc.baud(115200); + pc.baud(115000); } -void init_K64F() -{ - // on-board LEDs are active-low, so set pin high to turn them off. - r_led = 1; - g_led = 1; - b_led = 1; - - // since the on-board switches have external pull-ups, we should disable the internal pull-down - // resistors that are enabled by default using InterruptIn - sw2.mode(PullNone); - sw3.mode(PullNone); -}