![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Rev 1.6 - Sample Period Work in progress
Dependencies: mbed Bitmap N5110 TMP102 Joystick
Diff: main.cpp
- Revision:
- 8:9c5ef970de26
- Parent:
- 7:ef1dab708752
- Child:
- 9:77a6ea988e01
diff -r ef1dab708752 -r 9c5ef970de26 main.cpp --- a/main.cpp Thu Dec 30 15:49:14 2021 +0000 +++ b/main.cpp Fri Jan 07 09:21:20 2022 +0000 @@ -26,6 +26,7 @@ N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); // Create lcd objec Serial serial(USBTX,USBRX); // CoolTerm TX, RX Comms Setup for Debug AnalogIn SP(PTB2); // Potentiometer for Setpoint +Timer timer(); // USE FOR LOGGING BETWEEN 0-10s DigitalOut RED_led(LED_RED); // On-board K64F LED'S DigitalOut GRN_led(LED_GREEN); @@ -34,7 +35,7 @@ InterruptIn sw2(SW2); // On-board K64F Switches InterruptIn sw3(SW3); -//Timer timer(); // USE FOR LOGGING BETWEEN 0-10s + /*======================= Void Declaration ===================================*/ void error(); // Error Hang Code Function void init_serial(); // Setup serial port Function @@ -53,10 +54,13 @@ while (1) { - //timer.start(); + //timer.start(); + //for(i = 0; i < 10; i++){ // read temperature and print over serial port float T = tmp102.get_temperature(); serial.printf("T = %f C\n",T); + //serial.printf("%2.2fs: %3.1f deg C\n\r", timer.read(), T); + //timer.end(); // small delay - 1s to match the update rate of the sensor (1 Hz) lcd.clear(); // clear buffer at start of every loop