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:
- EiJay
- Date:
- 2014-07-25
- Revision:
- 6:c09f0df4123c
- Parent:
- 5:92add1a06191
- Child:
- 7:7a91079a5ddd
File content as of revision 6:c09f0df4123c:
#include "mbed.h" #include "MLX90393.h" int main() { //mBed indicators DigitalOut myled(LED1); //PC-communication Serial pc (USBTX, USBRX); pc.baud(9600); char hostCommand; char hostData1; char hostData2; char hostData3; //Chip communication SPI spi(p5, p6, p7); spi.format(MLX90393::spi_bits,MLX90393::spi_mode); spi.frequency(1000000); MLX90393 sensor(p26,&spi); //variables char read_buffer[10]; //if you remove this line the program will fail hostCommand = 0; while(1) { pc.scanf(" %i, %i, %i, %i", &hostCommand, &hostData1, &hostData2, &hostData3); switch(hostCommand) { case 0: { break; } case 1: { break; } case 2: { break; } case 3: { break; } case 4: { break; } case 5: { //exit //printf("**case5** \n\r"); sensor.EX(read_buffer,1); break; } case 6: { //single measurement sensor.SM(read_buffer,hostData1,1); break; } case 7: { break; } case 8: { //burst sensor.SB(read_buffer,hostData1,1); break; } case 9: { //wake up on change sensor.SWOC(read_buffer,hostData1,1); break; } } } }