12
STEP1:
Plug the Crowtail-Base Shield
onto the Arduino or Crowduino Board.
Hardware Connection
STEP2:
Connect Crowtail-LED to Crowtail-Base
shield’s D3 and Crowtail-Rotary angle sensor to
A0 port. The complete connection is as follows:
Open the
P05_Breathing_Light
with Arduino
IDE and upload it.
false. By judging the returned value, we can easily execute the corresponding code according to the
difference of values.
Modular programming allows us to better manage and call our code, such as a module code problem,
we only need to modify the code inside the module, without modifying the code of the entire program.
In addition, modularizing the code allows us to implement functions with simpler logic.
Modular programming: void turnOnLED(){} void turnOffLED(){} boolean
isPeopleDetected(){}
Lesson 5 – Breathing light
Introduction
Crowduino UNO-SD/Arduino UNO x1
Crowtail – Base Shield x1
Crowtail – Rotary Angle Sensor x1
Crowtail – LED(Green) x1
Crowtail – Cable x2
USB Cable x1
Required Parts
This rotary angle sensor may also be known as potentiometer twig
that produces analog output between 0 and VCC (5V DC with
Crowduino) on its SIG pin. The angular range is 300 degrees with a
linear change in value. The resistance value is 10k ohms, perfect for
Arduino use. Some applications like smart light control, volume
control, only you can not think of things, no impossible things! For
this lesson, we will use rotary angle sensor and led to make a
breathing light, you can control the brightness of led like human
breathing!
Содержание Crowtail
Страница 48: ......