Starting with Bling
Spartronics has two projects for introducing Arduino development using bling.
Intro to Arduino is a
simple introduction with step by step demonstration of adding new
functionality.
Bling Demo 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 Ladyada's Learn Arduino Tutorials. Also, there are many good tutorials on YouTube, such as this one
Bling Demo
Introduction to bling development uses Adafruit NeoPixel strip and ring components. Demo board also has a potentiometer for demonstrating sensor interaction.
Setup
For sketch code and hardware requirements see BlingDemoSystem Repo
Board: Arduino Uno
If you need to install Arduino IDE, see instructions
[Install Adafruit NeoPixel
Library](https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-installation)
to Arduino IDE
Clone BlingDemoSystem Repo. If you need help, see instructions here
Learning Path
Also see Arduino Tutorial for reference.
Introduce [Arduino Uno
board](https://www.tutorialspoint.com/arduino/arduino_board_description.htm),
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
structure](https://www.tutorialspoint.com/arduino/arduino_program_structure.htm):
setup()
andloop()
functions.Introduce data types, variables, functions
Introduce simple debugging with
println()
Show how potentiometer sensor is read and how NeoPixel is controlled.
Also discuss [Arduino I/O
functions](https://www.tutorialspoint.com/arduino/arduino_io_functions.htm):
pinMode()
,digitalWrite()
andanalogRead()
functions.
Exercises and Code Experiments
Understand RGB and pixel numbering by changing the
setup()
code on how the strip/ring is initialized.Experiment with online RGB colors and see how they perform on the NeoPixel.
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.
Adafruit NeoPixel Documentation
See Adafruit NeoPixel Uberguide for documentation on how to use the library.
Key sections:
Include library:
#include <Adafruit_Neopixel.h>
Specify
LED_PIN
andLED_COUNT
Declare
Adafruit_NeoPixel
object -- can be a ring or a stripWhen using the NeoPixel function, make sure to specify the
Adafruit_NeoPixel object
In
setup()
function callbegin()
to prepare data pin NeoPixel outputCommon 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)
wherecolor
is a 32-bittype that represents RGB
fill()
function to set same color to multiple pixelsclear()
function to turn off all pixels to 0 brightnessgetPixelColor()
to query existing pixel valuesetBrightness()
to specify brightness level of all pixels
show()
to push the color data to the NeoPixel object, otherwisecolor changes will not be displayed
Bling Code Samples
Last updated