Thank you very much my friend!
I am very surprised to see that there is already v6. I’m a certainly not a programmer, but more of a mechanical engineer, so these are some new waters for me to swim in. I managed to get my “cardboard” dash up and running with one servo and couple of LED’s just to see if everything works.
I’m still waiting for some more servos to arrive, (starter kit only contained one) so I can continue my project. Probably I will start editing .ino file because I want to recreate complete dashboard of MAN TGX. I’m designing it peace by peace for 3D printing so everyone with a printer and Arduino board can recreate it.
But there will probably be some obstacles that I will ran in to. I hope you can help me with some of those.
Firstly I saw that you are adding new functions to you DLL so Arduino can get more and more info from the game. I think I figure it out that everything you put at the end of plugin.CPP file can be understood by Arduino. If that is correct I am asking if you can add all the stuff that Silas has in his v2, because there are some parameters (fuel consumption for example, and in the future maybe angular velocities for condoling cockpit movement – but that just dreaming right now.)) that would come in handy to me and create new DLL (maybe v7?). I just don’t know how to build my own DLL and if adding lines in .CPP is all there is to do.
Code: Select all
REG_COMMON_CHAN(local_scale, float);
REG_COMMON_CHAN(game_time, u32);
REG_COMMON_CHAN(next_rest_stop, s32);
REG_TRUCK_CHAN(world_placement, dplacement);
REG_TRUCK_CHAN(local_linear_velocity, fvector);
REG_TRUCK_CHAN(local_angular_velocity, fvector);
REG_TRUCK_CHAN(local_linear_acceleration, fvector);
REG_TRUCK_CHAN(local_angular_acceleration, fvector);
REG_TRUCK_CHAN(cabin_offset, fplacement);
REG_TRUCK_CHAN(cabin_angular_velocity, fvector);
REG_TRUCK_CHAN(cabin_angular_acceleration, fvector);
REG_TRUCK_CHAN(head_offset, fplacement);
REG_TRUCK_CHAN(speed, float);
REG_TRUCK_CHAN(engine_rpm, float);
REG_TRUCK_CHAN(engine_gear, s32);
REG_TRUCK_CHAN(displayed_gear, s32);
REG_TRUCK_CHAN(input_steering, float);
REG_TRUCK_CHAN(input_throttle, float);
REG_TRUCK_CHAN(input_brake, float);
REG_TRUCK_CHAN(input_clutch, float);
REG_TRUCK_CHAN(effective_steering, float);
REG_TRUCK_CHAN(effective_throttle, float);
REG_TRUCK_CHAN(effective_brake, float);
REG_TRUCK_CHAN(effective_clutch, float);
REG_TRUCK_CHAN(cruise_control, float);
REG_TRUCK_CHAN(hshifter_slot, u32);
// hshifter_selector
REG_TRUCK_CHAN(parking_brake, bool);
REG_TRUCK_CHAN(motor_brake, bool);
REG_TRUCK_CHAN(retarder_level, u32);
REG_TRUCK_CHAN(brake_air_pressure, float);
REG_TRUCK_CHAN(brake_air_pressure_warning, bool);
REG_TRUCK_CHAN(brake_air_pressure_emergency, bool);
REG_TRUCK_CHAN(brake_temperature, float);
REG_TRUCK_CHAN(fuel, float);
REG_TRUCK_CHAN(fuel_warning, bool);
REG_TRUCK_CHAN(fuel_average_consumption, float);
REG_TRUCK_CHAN(fuel_range, float);
REG_TRUCK_CHAN(adblue, float);
REG_TRUCK_CHAN(adblue_warning, bool);
//REG_TRUCK_CHAN(adblue_average_consumption, float);
REG_TRUCK_CHAN(oil_pressure, float);
REG_TRUCK_CHAN(oil_pressure_warning, bool);
REG_TRUCK_CHAN(oil_temperature, float);
REG_TRUCK_CHAN(water_temperature, float);
REG_TRUCK_CHAN(water_temperature_warning, bool);
REG_TRUCK_CHAN(battery_voltage, float);
REG_TRUCK_CHAN(battery_voltage_warning, bool);
REG_TRUCK_CHAN(electric_enabled, bool);
REG_TRUCK_CHAN(engine_enabled, bool);
REG_TRUCK_CHAN(lblinker, bool);
REG_TRUCK_CHAN(rblinker, bool);
REG_TRUCK_CHAN(light_lblinker, bool);
REG_TRUCK_CHAN(light_rblinker, bool);
REG_TRUCK_CHAN(light_parking, bool);
REG_TRUCK_CHAN(light_low_beam, bool);
REG_TRUCK_CHAN(light_high_beam, bool);
REG_TRUCK_CHAN(light_aux_front, u32);
REG_TRUCK_CHAN(light_aux_roof, u32);
REG_TRUCK_CHAN(light_beacon, bool);
REG_TRUCK_CHAN(light_brake, bool);
REG_TRUCK_CHAN(light_reverse, bool);
REG_TRUCK_CHAN(wipers, bool);
REG_TRUCK_CHAN(dashboard_backlight, float);
REG_TRUCK_CHAN(wear_engine, float);
REG_TRUCK_CHAN(wear_transmission, float);
REG_TRUCK_CHAN(wear_cabin, float);
REG_TRUCK_CHAN(wear_chassis, float);
REG_TRUCK_CHAN(wear_wheels, float);
REG_TRUCK_CHAN(odometer, float);
REG_TRUCK_CHAN(navigation_distance, float);
REG_TRUCK_CHAN(navigation_time, float);
REG_TRUCK_CHAN(navigation_speed_limit, float);
REG_TRAILER_CHAN(connected, bool);
REG_TRAILER_CHAN(world_placement, dplacement);
REG_TRAILER_CHAN(local_linear_velocity, fvector);
REG_TRAILER_CHAN(local_angular_velocity, fvector);
REG_TRAILER_CHAN(local_linear_acceleration, fvector);
REG_TRAILER_CHAN(local_angular_acceleration, fvector);
REG_TRAILER_CHAN(wear_chassis, float);
And here is the link to his files:
https://github.com/skyhisi/ets2_dashboard_v2
And my second question is, how do I know which serial byte is connected to which truck light. (and is Truck light byte or warnig light byte) Is there any file where these numbers are written? And how those it work with servos, because there isn’t any numbering used in the brackets.
Here is the part of the .ino file I’m referring to.
Code: Select all
read_serial_byte_set_servo(speedo, SERVO_DIR_INVERT); // Speed
read_serial_byte_set_servo(rpm, SERVO_DIR_INVERT); // RPM
skip_serial_byte(); // Brake air pressure
skip_serial_byte(); // Brake temperature
skip_serial_byte(); // Fuel ratio
skip_serial_byte(); // Oil pressure
skip_serial_byte(); // Oil temperature
skip_serial_byte(); // Water temperature
skip_serial_byte(); // Battery voltage
// Truck lights byte
serial_byte = Serial.read();
digitalWriteFromBit(LEFT_INDICATOR, serial_byte, 5);
digitalWriteFromBit(RIGHT_INDICATOR, serial_byte, 4);
// Warning lights bytes
serial_byte = Serial.read();
digitalWriteFromBit(PARKING_BREAK, serial_byte, 7);
digitalWriteFromBit(FUEL_WARNING, serial_byte, 3);
Hope you, or anyone else reading this can help me with my current obstacles. Thank you in advance.