Digital dashboard

hey, for an assignment we have to create a digital dashboard which shows speed in Km/hr, fuel level in liters, RPM. This is the code I’ve done so far. I’d really appreciate any help. Thanks in advance. I’m really new to processing and this task seems very daunting to me.

Gauge fuelGauge;
int InputDecision;
boolean CallDataInitial = true;

void keyPressed() {
 int keyNum = Character.getNumericValue(key);
 if(keyNum<=3 && keyNum>-1)InputDecision = keyNum;

void DataInitial (){
  if (InputDecision==1){
    sensor = new SensorDataProvider("Car_status_BMW_323i.csv"); 
    myCar= new Car(0.23,60);
   speedometer = new Gauge();
   speedometer.setCenterPos(width/2 -400, 350);
1 Like

Do you get any errors or are you stuck implementing certain feature?

Design your dashboard using pen and paper, or any on the market sketch/mockup software if you are familiar with them. Then defined the functionality of each control and add the description of each control’s visual state. For instance, start with the gas control. Then add that speed gauge and then the RPM gauge.

Notice you do not need to implement these controls. The library controlP5 or G4P provide UI controls that you could use in your project if you like them, or you could design your own.


1 Like

Is your primary concern how to implement the metrics, or how to draw the display? There are a number of recent discussions on the forum of “gauge”, “dial”, etc. regarding display approaches.

more so on how to display changing values for each gauge. The values are in a csv file.

Are you playing back a static csv as an animation, or is the csv being updated on disk and you are periodically reloading it to display the last values…?

the csv has all the data preloaded. nothing is changing or being updated

So its a long list of RPM and fuel levels and i need to have the values changing as if it were a real dashboard in a car.

Then it sounds like you may want to look at using loadTable() to import your csv as a Table, loop over the TableRows every x milliseconds / frames, and update the drawing each frame based on the contents of a TableRow.