Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Si4703 mbed millis
main.cpp@0:11630d0d8271, 2015-12-24 (annotated)
- Committer:
- vodavprasku
- Date:
- Thu Dec 24 14:46:49 2015 +0000
- Revision:
- 0:11630d0d8271
- Child:
- 1:ebbd4cc237bc
123
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vodavprasku | 0:11630d0d8271 | 1 | #include "mbed.h" |
vodavprasku | 0:11630d0d8271 | 2 | #include "SparkFun-Si4703.h" |
vodavprasku | 0:11630d0d8271 | 3 | #include "SSD1306.h" |
vodavprasku | 0:11630d0d8271 | 4 | |
vodavprasku | 0:11630d0d8271 | 5 | |
vodavprasku | 0:11630d0d8271 | 6 | Serial pc(USBTX, USBRX); // tx, rx |
vodavprasku | 0:11630d0d8271 | 7 | Si4703_Breakout radio(I2C_SDA, I2C_SCL, PTA1, &pc); |
vodavprasku | 0:11630d0d8271 | 8 | |
vodavprasku | 0:11630d0d8271 | 9 | int current_frequency; |
vodavprasku | 0:11630d0d8271 | 10 | char txt[] = "TEST"; |
vodavprasku | 0:11630d0d8271 | 11 | char fm[5]; |
vodavprasku | 0:11630d0d8271 | 12 | char rds[10]; |
vodavprasku | 0:11630d0d8271 | 13 | |
vodavprasku | 0:11630d0d8271 | 14 | int main() { |
vodavprasku | 0:11630d0d8271 | 15 | init(); |
vodavprasku | 0:11630d0d8271 | 16 | cls(); |
vodavprasku | 0:11630d0d8271 | 17 | |
vodavprasku | 0:11630d0d8271 | 18 | locate(0, 0); |
vodavprasku | 0:11630d0d8271 | 19 | OLED_ShowStr(0, 0, txt, 1); |
vodavprasku | 0:11630d0d8271 | 20 | OLED_ShowStr(0, 1, "Ahoj", 1); |
vodavprasku | 0:11630d0d8271 | 21 | |
vodavprasku | 0:11630d0d8271 | 22 | radio.powerOn(); |
vodavprasku | 0:11630d0d8271 | 23 | |
vodavprasku | 0:11630d0d8271 | 24 | |
vodavprasku | 0:11630d0d8271 | 25 | |
vodavprasku | 0:11630d0d8271 | 26 | |
vodavprasku | 0:11630d0d8271 | 27 | while(1){ |
vodavprasku | 0:11630d0d8271 | 28 | current_frequency = radio.seekUp(); |
vodavprasku | 0:11630d0d8271 | 29 | sprintf(fm, "%d", current_frequency); |
vodavprasku | 0:11630d0d8271 | 30 | OLED_ShowStr(0, 2, fm, 1); |
vodavprasku | 0:11630d0d8271 | 31 | wait_ms(500); |
vodavprasku | 0:11630d0d8271 | 32 | } |
vodavprasku | 0:11630d0d8271 | 33 | } |