Reversion for IoT con
Dependencies: MAX30205 max32630fthr USBDevice
Diff: main.cpp
- Revision:
- 1:a61d9a05e76f
- Parent:
- 0:f205abc96ff9
--- a/main.cpp Tue May 15 19:13:28 2018 +0000 +++ b/main.cpp Wed Jun 19 08:02:10 2019 +0000 @@ -38,7 +38,8 @@ MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); // Virtual serial port over USB -USBSerial microUSB; +//USBSerial microUSB; +Serial uart2(P3_1, P3_0,9600); DigitalOut rLED(LED1); DigitalOut gLED(LED2); @@ -83,10 +84,10 @@ bLED = LED_OFF; wait(0.05); - printf("Example program for MAX20305.\r\n"); + uart2.printf("Example program for MAX20305.\r\n"); ret = bodyTempSensor.readTHYST(hystValue); if (ret != 0) { - printf("Communications to MAX20305 Failed: ret=%d, Thyst=0x%04X\r\n",ret, hystValue); + uart2.printf("Communications to MAX20305 Failed: ret=%d, Thyst=0x%04X\r\n",ret, hystValue); rLED = LED_ON; } @@ -96,8 +97,8 @@ { expandTemperatureValue = (uint32_t)temperatureValue; Celsius = bodyTempSensor.toCelsius(expandTemperatureValue); - printf("The temperature is %f Celsius, ",Celsius); - printf("%f Fahrenheit\r\n",bodyTempSensor.toFahrenheit(Celsius)); + uart2.printf("The temperature is %f Celsius, ",Celsius); + uart2.printf("%f Fahrenheit\r\n",bodyTempSensor.toFahrenheit(Celsius)); rLED = LED_OFF; gLED = !gLED; // blink the green red