EasyManua.ls Logo

Keyestudio Ks0428 - Extension Practice

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...
89
www.keyestudio.com
analogRead(sensorPin):read the analog value of photoresistor via
analog ports.
Serial.begin(9600): Initialize the serial port, baud rate of serial
communication is 9600
Serial.println : Serial port prints and word wrap.
(7) Extension Practice
We ve known how to read the value of photoresistor. Let s
combine photoresistor with LED and view the status of LED.
PWM restrains the brightness, so LED is linked with PWM pins,
connect LED to pin 10, keep pin of photoresistor unchanged, then
design the code:
/*keyestudio Mini Tank Robot V2
lesson 3.2
photocell-analog output
http://www.keyestudio.com

Table of Contents

Related product manuals