Tracker+TPMS
/
Memoria
Programa escribiendo en la memoria FM24V10 y enviando la data a la UART2
Diff: main.cpp
- Revision:
- 0:02fefd1e37a0
diff -r 000000000000 -r 02fefd1e37a0 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Sep 11 21:12:35 2016 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +#include "FM24V10.h" + + +#define SDA P0_0 +#define SCL P0_1 + +#define SERIAL_TX_UART2 P0_15 +#define SERIAL_RX_UART2 P0_16 + +Serial UART2(SERIAL_TX_UART2, SERIAL_RX_UART2); + + +FM24V10 Memoria(SDA,SCL,1,1); +DigitalOut myled(P0_22); + +int main() { + int prueba; + + UART2.baud(9600); + UART2.format(8,Serial::None,1); + + while(1) { + myled = 1; + wait(1); + myled = 0; + wait(2); + Memoria.WriteShort(0x000000,1,false); + prueba=Memoria.ReadShort(0x000000,false); + UART2.printf("%d",prueba); + + } +}