![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
rx
main.cpp@0:a8a44ece474d, 2019-11-04 (annotated)
- Committer:
- SamirIss
- Date:
- Mon Nov 04 08:27:01 2019 +0000
- Revision:
- 0:a8a44ece474d
- Child:
- 1:0af2871d628a
Recept spi with lib
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
SamirIss | 0:a8a44ece474d | 1 | #include "mbed.h" |
SamirIss | 0:a8a44ece474d | 2 | #include "RFM69.h" |
SamirIss | 0:a8a44ece474d | 3 | DigitalOut myled(LED1); |
SamirIss | 0:a8a44ece474d | 4 | RFM69 ant(A6,A5,A4,D7,D8); //PinName mosi, PinName miso, PinName sclk, PinName slaveSelectPin, PinName interrupt |
SamirIss | 0:a8a44ece474d | 5 | Serial pc(D1,D0); |
SamirIss | 0:a8a44ece474d | 6 | int main() { |
SamirIss | 0:a8a44ece474d | 7 | while(1) |
SamirIss | 0:a8a44ece474d | 8 | { |
SamirIss | 0:a8a44ece474d | 9 | ant.setFrequency(43); |
SamirIss | 0:a8a44ece474d | 10 | ant.readAllRegs(); |
SamirIss | 0:a8a44ece474d | 11 | uint8_t test = ant.readReg(0x00); |
SamirIss | 0:a8a44ece474d | 12 | pc.printf("com : 0x%02x\n", test); |
SamirIss | 0:a8a44ece474d | 13 | wait(0.4); |
SamirIss | 0:a8a44ece474d | 14 | } |
SamirIss | 0:a8a44ece474d | 15 | } |