Test the HalfDuplex library bypassing the MX12 library
Dependencies: mbed-src
Fork of MX106-custom by
main.cpp
- Committer:
- dconsoli
- Date:
- 2016-04-28
- Revision:
- 3:d44622fe4fac
- Parent:
- 1:946c65496383
File content as of revision 3:d44622fe4fac:
#include "mbed.h" #include "SerialHalfDuplex.h" // connettere insieme D2, D8, Rpu_5V=10kohm e MX106_data Serial pc(SERIAL_TX, SERIAL_RX); SerialHalfDuplex MX106(PA_9, PA_10); int main() { pc.printf("Si comincia \n"); /* pc.printf("Scrivo il comando di accensione LED \n"); MX106.putc(0xFF); MX106.putc(0xFF); MX106.putc(0x01); MX106.putc(0x04); MX106.putc(0x03); MX106.putc(0x19); MX106.putc(0x01); MX106.putc(0xDD); while (1) { if(MX106.readable()){ pc.printf("ricevuto %c \n", MX106.getc()); } } */ pc.printf("Scrivo il comando di lettura temperatura \n"); MX106.putc(0xFF); MX106.putc(0xFF); MX106.putc(0x01); MX106.putc(0x04); MX106.putc(0x02); MX106.putc(0x2B); MX106.putc(0x01); MX106.putc(0xCC); while (1) { if(MX106.readable()){ pc.printf("ricevuto %c \n", MX106.getc()); } } }