0
Implement code that simulates the speed of a car as more noise signal, with 50 elements. The speed value increases linear mode by 0-50 km/h. The noise amplitude is 1 km/h. Values are sent to the console with significant three-digit accuracy. Show example of results on console and plotter. How would the noise?
float maximo = 50;
float minimo = 0;
float variac = 1;
float percent = ?;
float N = (maximo - minimo) / abs(variac);
float amplitude = (maximo - minimo)/2;
float offset = (maximo + minimo)/2;
void setup(){
Serial.begin(2400);
for(int i=0;i<=N;i++){
Serial.print(variac*i +minimo);
Serial.println(percent*amplitude*random(-100,101)/100.0);
Serial.println(percent*amplitude*random(-100,101)/100.0 + variac*i +minimo, 6);
}
}
I believe these videos can help with the concept: https://www.youtube.com/playlist?list=PLKqXX49sH6-ELYsur_uaS8dW34BB7vF6
– Jefferson Quesado