AUC Team
/
progettoauc
progetto finale
Fork of ProgettoAUC by
Diff: main.cpp
- Revision:
- 0:7b9184b3ceba
- Child:
- 1:84d896b9240b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 26 14:59:17 2016 +0000 @@ -0,0 +1,32 @@ + +#include "mbed.h" + +I2C radio(D14, D15); //sda, sc1 + +Serial pc(USBTX, USBRX); //tx, rx +InterruptIn button (PC_13); + +const int addr = 0xC0; + +char config_t[6]; +char read_t[6]; + +void prevfreq(){ + //config_t[2]=0x50; + radio.write(addr, config_t, 5); + //config_t[2]=0xD0; + } + +int main() { + +//config_t[0] = 0xC0; +config_t[0] = 0x40; +config_t[1] = 0x00; // config data byte2 +config_t[2] = 0xD0; +config_t[3] = 0x01; +config_t[4] = 0x00; + +//radio.write(addr, config_t, 5); +button.rise(&prevfreq); + +}