Read tire temps from CAN
This commit is contained in:
@ -67,16 +67,26 @@ String get_value(Value val) {
|
||||
case VAL_RPM:
|
||||
return String(Vehicle_data.revol / 2);
|
||||
case VAL_TT_FL:
|
||||
return "00";
|
||||
return String(Vehicle_data.t_tfl * 0.423529 + 8, 0);
|
||||
case VAL_TT_FR:
|
||||
return "01";
|
||||
return String(Vehicle_data.t_tfr * 0.423529 + 0, 0);
|
||||
case VAL_TT_RL:
|
||||
return "10";
|
||||
return String(Vehicle_data.t_trl * 0.423529 + 11, 0);
|
||||
case VAL_TT_RR:
|
||||
return "11";
|
||||
case VAL_LAPTIME:
|
||||
return String(
|
||||
Vehicle_data.lap_time_sec + Vehicle_data.lap_time_msec / 1000.0, 2);
|
||||
return String(Vehicle_data.t_trr * 0.423529 + 4, 0);
|
||||
case VAL_LAPTIME: {
|
||||
double time =
|
||||
Vehicle_data.lap_time_sec + Vehicle_data.lap_time_msec / 1000.0;
|
||||
if (time < 100) {
|
||||
return String(time, 2);
|
||||
} else if (time < 1000) {
|
||||
return String(time, 1);
|
||||
} else if (time < 10000) {
|
||||
return String(time, 0);
|
||||
} else {
|
||||
return "2SLOW";
|
||||
}
|
||||
}
|
||||
case VAL_UBATT:
|
||||
return String(0.0706949 * Vehicle_data.u_batt, 2);
|
||||
case VAL_TMOT:
|
||||
@ -347,10 +357,10 @@ void update_view_driver() {
|
||||
gear_box.update_value(get_value(VAL_GEAR));
|
||||
left_box.update_value(get_value(left_box_value));
|
||||
right_box.update_value(get_value(VAL_RPM));
|
||||
fl_box.update_value(2);
|
||||
fr_box.update_value(55);
|
||||
rl_box.update_value(65);
|
||||
rr_box.update_value(90);
|
||||
fl_box.update_value(get_value(VAL_TT_FL).toInt());
|
||||
fr_box.update_value(get_value(VAL_TT_FR).toInt());
|
||||
rl_box.update_value(get_value(VAL_TT_RL).toInt());
|
||||
rr_box.update_value(get_value(VAL_TT_RR).toInt());
|
||||
}
|
||||
|
||||
void redraw_view_testing() {
|
||||
|
||||
Reference in New Issue
Block a user