Dependencies: C12832 LM75B mbed
Revision 1:31fe0ded0536, committed 2015-10-10
- Comitter:
- dwijaybane
- Date:
- Sat Oct 10 07:00:55 2015 +0000
- Parent:
- 0:07ac0555709d
- Commit message:
- comments updated
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Oct 06 09:52:45 2015 +0000 +++ b/main.cpp Sat Oct 10 07:00:55 2015 +0000 @@ -1,19 +1,21 @@ -#include "mbed.h" -#include "LM75B.h" -#include "C12832.h" +#include "mbed.h" // Basic Library required for onchip peripherals +#include "LM75B.h" // Library for LM75B I2C based Temperature sensor +#include "C12832.h" // Library for SPI based LCD -C12832 lcd(p5, p7, p6, p8, p11); -LM75B tmp(p28,p27); //I2C Temperature Sensor +/* Create Objects */ +C12832 lcd(p5, p7, p6, p8, p11); // Initialize lcd object with SPI pins +LM75B tmp(p28,p27); // Initialize I2C pins for Temperature Sensor +/* Main Program */ int main () { - float board_temp; + float board_temp; // Value in float while (1) { - lcd.cls(); - lcd.locate(0,0); //clears LCD - board_temp = tmp; //read temperature - lcd.printf("Board Temperature = %.2f\n\r",board_temp); - wait(1.0); + lcd.cls(); // Clear LCD Screen + lcd.locate(0,0); // Reset Coordinate + board_temp = tmp; // read temperature and store in floating point + lcd.printf("Board Temperature = %.2f\n\r",board_temp); // Display Temperature Value + wait(1.0); // 1 Sec delay } }