Starting with Bling
Last updated
Was this helpful?
Last updated
Was this helpful?
Spartronics has two projects for introducing Arduino development using bling.
is a
simple introduction with step by step demonstration of adding new
functionality.
uses Adafruit
NeoPixel strip and ring components to enable students with a sandbox
environment for experimentation.
Important: If this is your first time diving into Arduino, make sure to walk through . Also, there are many good tutorials on YouTube, such as
Introduction to bling development uses Adafruit NeoPixel strip and ring components. Demo board also has a potentiometer for demonstrating sensor interaction.
For sketch code and hardware requirements see
Board: Arduino Uno
If you need to install Arduino IDE, see instructions
[Install Adafruit NeoPixel
Library]()
to Arduino IDE
Clone BlingDemoSystem Repo. If you need help, see instructions
Introduce [Arduino Uno
how to connect to power and computer, and general layout of the pins
Give an overview of Arduino IDE (how to compile, upload, configure
IDE, ...) and introduce the term sketch which
is an Arduino program
Review how sketch code is mapped to Arduino board and bling hardware:
pins, NeoPixel configuration.
Discuss [Arduino sketch code
setup()
and loop()
functions.
Introduce
Introduce simple debugging with println()
Show how potentiometer sensor is read and how NeoPixel is controlled.
Also discuss [Arduino I/O
pinMode()
, digitalWrite()
and
analogRead()
functions.
Understand RGB and pixel numbering by changing the setup()
code on how the strip/ring is initialized.
Write new functions for different blink patterns:
rainbow
use potentiometer to change intensity of the leds without changing
the blink pattern
use potentiometer to control the number of pixels change color on
the strip: 0 everything off to 255 all pixels are on
Change blink rates and experiment with using light on/off as a
communication tool.
Key sections:
Include library: #include <Adafruit_Neopixel.h>
Specify LED_PIN
and LED_COUNT
Declare Adafruit_NeoPixel
object -- can be a ring or a strip
When using the NeoPixel function, make sure to specify the
Adafruit_NeoPixel object
In setup()
function call begin()
to prepare data pin NeoPixel output
Common commands -- don't forget to specify the NeoPixel object in the command strip.clear()
LED pixels numbered along the strip starting from 0 closest to the
Arduino board
setting pixel colors:
setPixelColor(pixel_number, R, G, B)
and RGB brightness levels
-- 0 is dimmest (off) and 255 max brightest
setPixelColor(pixel_number, color)
where color
is a 32-bit
type that represents RGB
fill()
function to set same color to multiple pixels
clear()
function to turn off all pixels to 0 brightness
getPixelColor()
to query existing pixel value
setBrightness()
to specify brightness level of all pixels
show()
to push the color data to the NeoPixel object, otherwise
color changes will not be displayed
Also see for reference.
board](),
structure]():
Introduce , ,
,
and
functions]():
Experiment with online and see how they perform on the NeoPixel.
See for documentation on how to use the library.