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.
Fork of Quadrocopter by
main.cpp@7:a54c97795013, 2017-08-06 (annotated)
- Committer:
- MarcoF89
- Date:
- Sun Aug 06 20:24:18 2017 +0000
- Revision:
- 7:a54c97795013
- Parent:
- 6:27a09e8bebfb
- Child:
- 8:769ff3814355
Taster, Poti und Q-Brain integriert
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MarcoF89 | 6:27a09e8bebfb | 1 | #include "mbed.h" |
MarcoF89 | 6:27a09e8bebfb | 2 | #include "stdio.h" |
MarcoF89 | 6:27a09e8bebfb | 3 | #include <Timer.h> |
MarcoF89 | 6:27a09e8bebfb | 4 | #include "messen.h" |
MarcoF89 | 7:a54c97795013 | 5 | |
MarcoF89 | 6:27a09e8bebfb | 6 | static Serial pc(SERIAL_TX, SERIAL_RX); |
MarcoF89 | 6:27a09e8bebfb | 7 | static SPI spi(PE_6,PE_5,PE_2); //mosi,miso,sclk |
MarcoF89 | 6:27a09e8bebfb | 8 | static DigitalOut ncs(PE_4); //ssel |
MarcoF89 | 6:27a09e8bebfb | 9 | |
MarcoF89 | 7:a54c97795013 | 10 | static AnalogIn potis_1 (PF_3); |
MarcoF89 | 7:a54c97795013 | 11 | static AnalogIn potis_2 (PF_10); |
MarcoF89 | 7:a54c97795013 | 12 | static AnalogIn potis_3 (PF_4); |
MarcoF89 | 7:a54c97795013 | 13 | static AnalogIn potis_4 (PF_5); |
MarcoF89 | 7:a54c97795013 | 14 | |
MarcoF89 | 7:a54c97795013 | 15 | static DigitalIn taster1 (PG_7); |
MarcoF89 | 7:a54c97795013 | 16 | static DigitalIn taster2 (PD_10); |
MarcoF89 | 7:a54c97795013 | 17 | static DigitalIn taster3 (PG_14); |
MarcoF89 | 7:a54c97795013 | 18 | static DigitalIn taster4 (PF_12); |
MarcoF89 | 6:27a09e8bebfb | 19 | |
MarcoF89 | 6:27a09e8bebfb | 20 | int main() |
MarcoF89 | 6:27a09e8bebfb | 21 | { |
MarcoF89 | 6:27a09e8bebfb | 22 | initialisierung_gyro(); |
MarcoF89 | 6:27a09e8bebfb | 23 | initialisierung_acc (); |
MarcoF89 | 6:27a09e8bebfb | 24 | while(1) |
MarcoF89 | 6:27a09e8bebfb | 25 | { |
MarcoF89 | 6:27a09e8bebfb | 26 | pc.printf("\n\r"); |
MarcoF89 | 6:27a09e8bebfb | 27 | pc.printf("%ld\t%ld\t%ld\t%ld\t%ld\t%ld\t\r",aktuell_gyro_z(), aktuell_gyro_x(), aktuell_gyro_y(), aktuell_acc_x (), aktuell_acc_y (), aktuell_acc_z ()); |
MarcoF89 | 6:27a09e8bebfb | 28 | } |
MarcoF89 | 6:27a09e8bebfb | 29 | } |