Hello code for "Switch Science mbed LPC824"

Dependencies:   mbed

Fork of SwitchSciencembedLPC824_test by Mako SHIMURA

main.cpp

Committer:
asagin
Date:
2014-12-18
Revision:
9:e2333773718f
Parent:
7:553960b756ed
Child:
10:e508d79a907f

File content as of revision 9:e2333773718f:

/** Hello code for "test_LM75B" */

#include "mbed.h"
#include "TempSensor_LM75B.h"
#include "TextLCD_SB1602E.h"

#define        TEST_LOOP                    1
#define        DEFAULT_TIME_INTERVAL        1.0
#define        DEFAULT_TIME_INTERVAL_PUTx   0.2

#define        CONTRAST_ADJUST_TEST
#define        PRINTF_TEST
#define        CGRAM_FUNCTION_TEST
#define        PUTS_TEST_WITH_ESCAPE
#define        PUTS_TEST_WITHOUT_ESCAPE
#define        PUTC_TEST


I2C          i2c( dp4, dp5 );        // sda, scl 
TempSensor_LM75B        thermo_sensor_0( &i2c );  
TextLCD_SB1602E    lcd( &i2c );  //sda,,scl 液晶

/*デバッグ用*/
//Serial            pc( USBTX, USBRX ); // tx, rx 


int main()
{
    int    i    = 0;
    /*デバッグ用*/
//      pc.printf("test\r\n");
    while (1) {
            pc.printf( "  (%d)  sensor_0= %4.1f\r\n", i++, (float)thermo_sensor_0 );
            lcd.printf(0,"temp=\n");
            lcd.printf(1,"%4.1f\n",(float)thermo_sensor_0);
        wait( 1 );
    }