Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- ronaldhklee
- Date:
- 2017-03-21
- Revision:
- 0:599009dbb3e5
- Child:
- 1:eb3bd21fba0b
File content as of revision 0:599009dbb3e5:
#include "mbed.h" #include "mlx90614.h" DigitalOut myled(LED1); int SAddr = 0; float temp = 0; int main() { SAddr = MLX90614_SA_Read(); printf(" MLX90614 Slave Address Read = 0x%X. \n\r", SAddr); if (SAddr == 0xff) { SAddr = MLX90614_SA_Scan(); printf(" MLX90614 Slave Address Find = 0x%X. \n\r", SAddr); } wait(0.1); do temp = getTempC_Ambi(SAddr); while(temp == 0xffffffff); printf(" Ambient temperature = %.2f\r\n", temp); do temp = getTempC_Obj1(SAddr); while(temp == 0xffffffff); printf(" Object 1 temperature = %.2f\r\n", temp); do temp = getTempC_Obj2(SAddr); while(temp == 0xffffffff); printf(" Object 2 temperature = %.2f\r\n", temp); while(1) { myled = 1; // LED is ON wait(1.0); // 1000 ms myled = 0; // LED is OFF wait(1.0); // 1 sec } }