1
2
3
4
5
6
7
8
9
Introduction
Details
Guide Steps
Review
Quiz
At the tippity top of the code before the set-up or Serial.begin(9600) is where variables are defined. They need to be defined so when they are in a function, the computer will know what the variables means. The variables necessary for this sensor are...
const int trigPin=11;
const int echoPin=12;
long duration;
int distance;
int distance1;
float oldvalue=0;
float newvalue=0;
« Previous
Next »
Your contributions are licensed under the open source Creative Commons license.
Next line
Previous line
Insert a new line below
Insert a new line above
Indent current line
Unindent current line
Delete current line
Navigate to next step.
Navigate to previous step.