Rainbow - Waveshare Alphabot2 User Manual

For micro:bit
Table of Contents

Advertisement

Alphabot2 for micro:bit User Manual

RAINBOW

We create a new project, coding four RGB LEDs for rainbow effect.
1. Place
Set item to NeoPixel at pin P8 with 4 leds as (GRB format)
2. Create a variable hue, place
- these blocks can be created and founded in
3. Place
change hue to 1
4. Place
item show rainbow from 1 to 360
- the range of hue is 1~360, different hue values stand for different colors, this
block will show average hue (1~360) to 4 RGB LEDs. More the RGB LEDs, more
colors are showed like rainbow.
5. Use
0 + 0
and
hue
-
0 + 0
block can be found on
6. Download the script to micro:bit and test
set hue to 0
block in forever
block to complete the script
Math
package
block in
Variables
package
on start
34 / 76

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Waveshare Alphabot2

Table of Contents