-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
global/pbref values #7
Comments
try instead: float u[2]; try instead int currAngle; and set int currAngle = 90; in void setup() since in void setup() we write myservo.write(90) to the servo to make it start at angle 90; float sensorValue[nrOfFrontSensors]; and then intialize them to float sensorValue[nrOfFrontSensors] = {0,0,0}; in void setup(); to give them an initial value. change to: int readIndex[nrOfFrontSensors]; then put in void setup(): int readIndex[nrOfFrontSensors] = {0,0,0} to initalize it with the correct starting values change to: float total[nrOfFrontSensors]; then put in void setup(): float total[nrOfFrontSensors] = {0.0,0.0,0.0}; to initalize the vector with the correct starting values change to: float avgSensorValue[nrOfFrontSensors]; then in void setup(): float avgSensorValue[nrOfFrontSensors] = {0.0,0.0,0.0}; to initialize the vector with the correct starting values |
As Oleksi points out, we should not define a value to a globally defined variable unless it is a constant value, i.e const int nrOfSensor = 3; or whatever (just an example) |
The text was updated successfully, but these errors were encountered: