Keyestudio KS0436 Kit Manual page 51

Table of Contents

Advertisement

delay(10);// wait for 0.01 second
}
 Single line comments start with
Code Explanation:
of that line is considered a comment.
Comments are a great way to leave notes in your code explaining
why you wrote it the way you did.
 The first line of code is:
int potpin=0;// initialize analog pin 0
A variable is a placeholder for values that may change in your code.
You must introduce, or"declare,"variables before you use them.
Here we're declaring a variable called potPosition of type
Serial.begin(9600)
Serial commands can be used to send and receive data from your
computer. Notice that the baud rate, 9600, is the same as the one we
selected in the monitor. This is the speed at which the two devices
communicate, and it must match on both sides.
val=analogRead(potpin)
//
and everything up until the end
51
(integer).
int

Advertisement

Table of Contents
loading

Table of Contents