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: mbed MODSERIAL telemetry-master
main.cpp@1:ff0fc50372c8, 2015-05-05 (annotated)
- Committer:
- cheryl_he
- Date:
- Tue May 05 00:43:24 2015 +0000
- Revision:
- 1:ff0fc50372c8
- Parent:
- 0:453d27750ab3
- Child:
- 3:39e6440ccd45
telemetry setup
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| cheryl_he | 0:453d27750ab3 | 1 | #include "mbed.h" |
| cheryl_he | 1:ff0fc50372c8 | 2 | #include "telemetry.h" |
| cheryl_he | 1:ff0fc50372c8 | 3 | #include "telemetry-mbed.h" |
| cheryl_he | 1:ff0fc50372c8 | 4 | |
| cheryl_he | 1:ff0fc50372c8 | 5 | MODSERIAL telemetry_serial(PTA2, PTA1); |
| cheryl_he | 1:ff0fc50372c8 | 6 | telemetry::MbedHal telemetry_hal(telemetry_serial); |
| cheryl_he | 1:ff0fc50372c8 | 7 | telemetry::Telemetry telemetry_obj(telemetry_hal); |
| cheryl_he | 1:ff0fc50372c8 | 8 | |
| cheryl_he | 1:ff0fc50372c8 | 9 | telemetry::Numeric<uint32_t> tele_time_ms(telemetry_obj, "time", "Time", "ms", 0); |
| cheryl_he | 1:ff0fc50372c8 | 10 | telemetry::NumericArray<uint16_t, 128> tele_linescan(telemetry_obj, "linescan", "Linescan", "ADC", 0); |
| cheryl_he | 1:ff0fc50372c8 | 11 | telemetry::Numeric<float> tele_motor_pwm(telemetry_obj, "motor", "Motor PWM", "%DC", 0); |
| cheryl_he | 0:453d27750ab3 | 12 | |
| cheryl_he | 0:453d27750ab3 | 13 | DigitalOut myled(LED1); |
| cheryl_he | 0:453d27750ab3 | 14 | |
| cheryl_he | 0:453d27750ab3 | 15 | int main() { |
| cheryl_he | 1:ff0fc50372c8 | 16 | |
| cheryl_he | 1:ff0fc50372c8 | 17 | telemetry_obj.transmit_header(); |
| cheryl_he | 1:ff0fc50372c8 | 18 | uint16_t data [128] = [0]; |
| cheryl_he | 1:ff0fc50372c8 | 19 | //uint16_t* data = cam1.read(); |
| cheryl_he | 1:ff0fc50372c8 | 20 | |
| cheryl_he | 0:453d27750ab3 | 21 | while(1) { |
| cheryl_he | 0:453d27750ab3 | 22 | myled = 1; |
| cheryl_he | 0:453d27750ab3 | 23 | wait(0.2); |
| cheryl_he | 0:453d27750ab3 | 24 | myled = 0; |
| cheryl_he | 0:453d27750ab3 | 25 | wait(0.2); |
| cheryl_he | 1:ff0fc50372c8 | 26 | |
| cheryl_he | 1:ff0fc50372c8 | 27 | /*for (uint16_t i=0; i<128; i++) { |
| cheryl_he | 1:ff0fc50372c8 | 28 | tele_linescan[i] = data[i]; |
| cheryl_he | 1:ff0fc50372c8 | 29 | } |
| cheryl_he | 1:ff0fc50372c8 | 30 | */ |
| cheryl_he | 1:ff0fc50372c8 | 31 | telemetry_obj.do_io(); |
| cheryl_he | 1:ff0fc50372c8 | 32 | |
| cheryl_he | 0:453d27750ab3 | 33 | } |
| cheryl_he | 0:453d27750ab3 | 34 | } |