![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Test Inteface
Dependencies: Adafruit_GFX mbed
main.cpp@0:53e425a9a114, 2017-04-27 (annotated)
- Committer:
- chrish
- Date:
- Thu Apr 27 07:41:38 2017 +0000
- Revision:
- 0:53e425a9a114
bfdb
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chrish | 0:53e425a9a114 | 1 | #include "mbed.h" |
chrish | 0:53e425a9a114 | 2 | #include "Adafruit_SSD1306.h" |
chrish | 0:53e425a9a114 | 3 | DigitalOut myled(LED1); |
chrish | 0:53e425a9a114 | 4 | |
chrish | 0:53e425a9a114 | 5 | /*==> Interface Display <==*/ |
chrish | 0:53e425a9a114 | 6 | I2C I2CDisp(PA_10, PA_9); |
chrish | 0:53e425a9a114 | 7 | Adafruit_SSD1306_I2c Disp(I2CDisp,PB_0); |
chrish | 0:53e425a9a114 | 8 | |
chrish | 0:53e425a9a114 | 9 | /*==> Interface Virtual COM PORT STProgrammer <==*/ |
chrish | 0:53e425a9a114 | 10 | Serial pc(SERIAL_TX, SERIAL_RX); |
chrish | 0:53e425a9a114 | 11 | |
chrish | 0:53e425a9a114 | 12 | |
chrish | 0:53e425a9a114 | 13 | /* ==> Interface BNO_055 Shuttle Board <== */ |
chrish | 0:53e425a9a114 | 14 | Serial BNO(PB_6, PB_7); |
chrish | 0:53e425a9a114 | 15 | DigitalOut BNO_RST(PB_1); |
chrish | 0:53e425a9a114 | 16 | DigitalOut BNO_InterfaceSEL(PA_0); |
chrish | 0:53e425a9a114 | 17 | |
chrish | 0:53e425a9a114 | 18 | |
chrish | 0:53e425a9a114 | 19 | |
chrish | 0:53e425a9a114 | 20 | int main() { |
chrish | 0:53e425a9a114 | 21 | /*Display Initialisierung*/ |
chrish | 0:53e425a9a114 | 22 | Disp.clearDisplay(); |
chrish | 0:53e425a9a114 | 23 | Disp.setRotation(2); |
chrish | 0:53e425a9a114 | 24 | Disp.printf("Hallo Davi \n"); |
chrish | 0:53e425a9a114 | 25 | Disp.printf("Siehe Dokumente ... \n"); |
chrish | 0:53e425a9a114 | 26 | Disp.display(); |
chrish | 0:53e425a9a114 | 27 | /* HELLO World PC*/ |
chrish | 0:53e425a9a114 | 28 | pc.printf("Hallo Davi !\n"); |
chrish | 0:53e425a9a114 | 29 | /* Initialisierung BNO055*/ |
chrish | 0:53e425a9a114 | 30 | BNO_RST = 1; // Reset Altive Low |
chrish | 0:53e425a9a114 | 31 | BNO_InterfaceSEL = 1; // Select UART Interface |
chrish | 0:53e425a9a114 | 32 | BNO.baud(115200); |
chrish | 0:53e425a9a114 | 33 | /*Format Default 8N1 = 8data, no Parity bit, one Stop bit*/ |
chrish | 0:53e425a9a114 | 34 | |
chrish | 0:53e425a9a114 | 35 | |
chrish | 0:53e425a9a114 | 36 | |
chrish | 0:53e425a9a114 | 37 | while(1) { |
chrish | 0:53e425a9a114 | 38 | myled = 1; // LED is ON |
chrish | 0:53e425a9a114 | 39 | wait(0.2); // 200 ms |
chrish | 0:53e425a9a114 | 40 | myled = 0; // LED is OFF |
chrish | 0:53e425a9a114 | 41 | pc.printf("Hallo Davi !\n"); |
chrish | 0:53e425a9a114 | 42 | wait(1.0); // 1 sec |
chrish | 0:53e425a9a114 | 43 | } |
chrish | 0:53e425a9a114 | 44 | } |