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
Fork of coolcarsuperfast by
Diff: main.cpp
- Revision:
- 27:b9062f7f1e7c
- Parent:
- 26:7439102e0d9f
--- a/main.cpp Thu May 07 01:26:24 2015 +0000
+++ b/main.cpp Thu May 07 22:55:19 2015 +0000
@@ -11,7 +11,7 @@
telemetry::Telemetry telemetry_obj(telemetry_hal);
telemetry::Numeric<uint32_t> tele_time_ms(telemetry_obj, "time", "Time", "ms", 0);
-telemetry::NumericArray<float, 128> tele_linescan(telemetry_obj, "linescan", "Linescan", "ADC", 0);
+telemetry::NumericArray<uint8_t, 128> tele_linescan(telemetry_obj, "linescan", "Linescan", "ADC", 0);
telemetry::Numeric<float> tele_motor_pwm(telemetry_obj, "motor", "Motor PWM", "%DC", 0);
//Outputs
@@ -100,8 +100,8 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Tuning Values that can make it or break it ~~~~~~~~~~~~~~~~~~~~~~~~
float pulsewidth = 0.2f;
-int intTimMod = 0;
-float maxValThresh = .12; //~.1 for earlier in the day, reduce it (maybe something like .05 - .01 or something) as it gets darker
+int intTimMod = 20;
+float maxValThresh = .05; //~.1 for earlier in the day, reduce it (maybe something like .05 - .01 or something) as it gets darker
bool turnSpeedControl = true; //have increased PWMs when turning when true.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -210,7 +210,7 @@
//interrupt.rise(&riseInterrupt);
tele_time_ms = t.read_ms();
for (uint16_t i=0; i<128; i++) {
- tele_linescan[i] = ADCdata[i];
+ tele_linescan[i] = (uint8_t) (ADCdata[i] * 128);
}
telemetry_obj.do_io();
if (firstTime){
