|
|
|
@ -353,13 +353,14 @@ static void cmd_adc(const char* _data){
|
|
|
|
|
if(Timer_getTick() - g_startMS >= loopInterval){
|
|
|
|
|
g_startMS=Timer_getTick();
|
|
|
|
|
|
|
|
|
|
// Print Potentiometer info
|
|
|
|
|
/* Print Potentiometer info */
|
|
|
|
|
sprintf(potiData, "Poti: %d", adc_get_poti());
|
|
|
|
|
//sprintf(potiData, "Poti: %f", (adc_get_poti() / 1023.0)); // uses floats - disabled for performance reasons.
|
|
|
|
|
print_string(potiData);
|
|
|
|
|
print_string(NEXT_LINE);
|
|
|
|
|
|
|
|
|
|
// Print LM35 temperature
|
|
|
|
|
/* Print LM35 temperature */
|
|
|
|
|
/* calculate the temperature from the ADC reading */
|
|
|
|
|
lm35 = (int)(adc_get_LM35() * 5000.0 / 1024 / 10);
|
|
|
|
|
sprintf(lm35Data, "LM35: %d\xC2\xB0 C", lm35);
|
|
|
|
|
//sprintf(lm35Data, "LM35: %f\xC2\xB0 C", (adc_get_LM35() * (5000 / 1024.0) / 10)); // uses floats - disabled for performance reasons.
|
|
|
|
|