EasyManua.ls Logo

Keyestudio Ks0428 - Test Code

Keyestudio Ks0428
247 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
87
www.keyestudio.com
The two photoresistor sensors are linked with A1 and A2, then
finish the experiment via photoresistor connected to A1. Let’s read
its analog value.
(4) Test Code
/*
keyestudio Mini Tank Robot V2
lesson 3.1
photocell
http://www.keyestudio.com
*/
int sensorPin = A1; // select the input pin for the photocell
int sensorValue = 0; // variable to store the value coming from the
sensor
void setup() {

Table of Contents