Version based on standard Serial library bun external buffer circuit needed
Dependencies: mbed
Revision 0:377c5905c70a, committed 2016-04-28
- Comitter:
- dconsoli
- Date:
- Thu Apr 28 12:17:43 2016 +0000
- Commit message:
- Version based on standard Serial library bun external buffer circuit needed
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 377c5905c70a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 28 12:17:43 2016 +0000 @@ -0,0 +1,60 @@ +#include "mbed.h" + +//------------------------------------ +// Hyperterminal configuration +// 9600 bauds, 8-bit data, no parity +//------------------------------------ + +Serial pc(SERIAL_TX, SERIAL_RX); +Serial MX106(PA_9, PA_10); +DigitalOut data_control(PB_5); + +int main() { + data_control = 0; //abilito la linea per la lettura + pc.printf("Si comincia \n"); + /* + pc.printf("Scrivo il comando di accensione LED \n"); + + data_control = 1; + + MX106.putc(0xFF); + MX106.putc(0xFF); + MX106.putc(0x01); + MX106.putc(0x04); + MX106.putc(0x03); + MX106.putc(0x19); + MX106.putc(0x01); + MX106.putc(0xDD); + + data_control = 0; + + while (1) { + if(MX106.readable()){ + pc.printf("ricevuto %c \n", MX106.getc()); + } + } + */ + + pc.printf("Scrivo il comando di lettura temperatura \n"); + + data_control = 1; + + MX106.putc(0xFF); + MX106.putc(0xFF); + MX106.putc(0x01); + MX106.putc(0x04); + MX106.putc(0x02); + MX106.putc(0x2B); + MX106.putc(0x01); + MX106.putc(0xCC); + + data_control = 0; + + while (1) { + if(MX106.readable()){ + pc.printf("ricevuto %c \n", MX106.getc()); + } + } +} + + \ No newline at end of file
diff -r 000000000000 -r 377c5905c70a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Apr 28 12:17:43 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/aae6fcc7d9bb \ No newline at end of file