Hello code for "Switch Science mbed LPC824"

Dependencies:   mbed

Fork of SwitchSciencembedLPC824_test by Mako SHIMURA

Committer:
asagin
Date:
Thu Dec 18 10:16:06 2014 +0000
Revision:
10:e508d79a907f
Parent:
9:e2333773718f
Child:
11:7e4aa2823fad
Hello code for "Switch Science mbed LPC824"

Who changed what in which revision?

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