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){
if(CallDataInitial){
sensor = new SensorDataProvider("Car_status_BMW_323i.csv");
sensor.initialize();
myCar= new Car(0.23,60);
speedometer = new Gauge();
speedometer.setRange(0,400);
speedometer.setCenterPos(width/2 -400, 350);
}
}
}
``
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.
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.
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…?
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.