Hello code for "Switch Science mbed LPC824"

Dependencies:   mbed

Fork of SwitchSciencembedLPC824_test by Mako SHIMURA

Committer:
asagin
Date:
Thu Dec 18 03:20:52 2014 +0000
Revision:
9:e2333773718f
Parent:
7:553960b756ed
Child:
10:e508d79a907f
Erased comment

Who changed what in which revision?

UserRevisionLine numberNew contents of line
okano 7:553960b756ed 1 /** Hello code for "test_LM75B" */
okano 7:553960b756ed 2
okano 0:f947ed831c67 3 #include "mbed.h"
asagin 9:e2333773718f 4 #include "TempSensor_LM75B.h"
asagin 9:e2333773718f 5 #include "TextLCD_SB1602E.h"
asagin 9:e2333773718f 6
asagin 9:e2333773718f 7 #define TEST_LOOP 1
asagin 9:e2333773718f 8 #define DEFAULT_TIME_INTERVAL 1.0
asagin 9:e2333773718f 9 #define DEFAULT_TIME_INTERVAL_PUTx 0.2
okano 0:f947ed831c67 10
asagin 9:e2333773718f 11 #define CONTRAST_ADJUST_TEST
asagin 9:e2333773718f 12 #define PRINTF_TEST
asagin 9:e2333773718f 13 #define CGRAM_FUNCTION_TEST
asagin 9:e2333773718f 14 #define PUTS_TEST_WITH_ESCAPE
asagin 9:e2333773718f 15 #define PUTS_TEST_WITHOUT_ESCAPE
asagin 9:e2333773718f 16 #define PUTC_TEST
okano 6:b57b9dcfb515 17
asagin 9:e2333773718f 18
asagin 9:e2333773718f 19 I2C i2c( dp4, dp5 ); // sda, scl
asagin 9:e2333773718f 20 TempSensor_LM75B thermo_sensor_0( &i2c );
asagin 9:e2333773718f 21 TextLCD_SB1602E lcd( &i2c ); //sda,,scl 液晶
asagin 9:e2333773718f 22
asagin 9:e2333773718f 23 /*デバッグ用*/
asagin 9:e2333773718f 24 //Serial pc( USBTX, USBRX ); // tx, rx
okano 6:b57b9dcfb515 25
okano 0:f947ed831c67 26
okano 0:f947ed831c67 27 int main()
okano 0:f947ed831c67 28 {
asagin 9:e2333773718f 29 int i = 0;
asagin 9:e2333773718f 30 /*デバッグ用*/
asagin 9:e2333773718f 31 // pc.printf("test\r\n");
asagin 9:e2333773718f 32 while (1) {
asagin 9:e2333773718f 33 pc.printf( " (%d) sensor_0= %4.1f\r\n", i++, (float)thermo_sensor_0 );
asagin 9:e2333773718f 34 lcd.printf(0,"temp=\n");
asagin 9:e2333773718f 35 lcd.printf(1,"%4.1f\n",(float)thermo_sensor_0);
okano 0:f947ed831c67 36 wait( 1 );
okano 0:f947ed831c67 37 }