• 1 Prelude
    • 1.1 What is a microcontroller
    • 1.2 Examples of what you can build and do
    • 1.3 What’s In The Can
    • 1.4 What’s On The Board
    • 1.5 Sensors & Extras Overview
  • 2 Getting Started
    • 2.1 Connecting To Snap
    • 2.2 Using Snap!
    • 2.3 Troubleshooting Connection
    • 2.4 Downloads
  • 3 Building The Robot
    • 3.1 Using Stepper Motors
    • 3.2 Using Servo Motors
    • 3.3 Assemble Shoni
    • 3.4 Programming the Robot
  • 4 Systems Thinking
    • 4.1 Circuits
    • 4.2 Binary Input/Output and Computers
    • 4.3 Blink An LED
    • 4.4 Button Input
  • 5 Getting Fancy
    • 5.1 Blink RGB
    • 5.2 Analog Input
    • 5.3 Light Sensor
    • 5.4 Pulse Width Modulation
    • 5.5 Breadboard & Wiring
  • 6 Sensors and Extras
    • 6.1 Potentiometer
    • 6.2 Ultrasonic distance
    • 6.3 Endstop Switch
    • 6.4 Force Sensitive Resistor
    • 6.5 Soil Humidity
    • 6.6 Temp/Humidity
    • 6.7 Relay
    • 6.8 Microphone
    • 6.9 Piezo Vibration
  • 7 Resources
    • 7.1 Final Frontier
    • 7.2 Using the Robot In A Can kit with the Arduino IDE
    • 7.3 More Resources…

Robot In A Can Guidebook

5.1 Blink RGB

We can use many GPIO pins to output or input at once. Let’s use a few at once to mix colors in our awesome Red Green Blue RGB. These are the primary colors of light, different then the primary colors of paint (Red Yellow Blue). When you mix paints together you get black, but when you mix these three colors of light together, you get white!

Wire Like This

GPIO # 4 <–> R

GPIO # 5 <–> B

Code Screenshot

Drag to the desired GPIO pin and then choose On or Off

Drag to the desired GPIO pin and then choose On or Off