Product Description
This is a brick component specially design for the Arduino board, you can light it up any color in the visible spectrum.
Using it with Arduino
It connects with four wires to the Arduino board.
The GND brick pin should be connected to the GND pin on the Arduino board and the IN1, IN2, IN3 pins to three different digital PWM pins on the Arduino.
By frequency variations on every PWM pin you can determine a color of your choice.
The source code is below :
int redPin = 5; int greenPin = 9; int bluePin = 6; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { color(255, 0, 0); delay(1000); color(0, 255, 0); delay(1000); color(0, 0, 255); delay(1000); color(255, 255, 0); delay(1000); color(80, 0, 80); delay(1000); color(0, 255, 255); delay(1000); } void color(int red, int green, int blue) { analogWrite(redPin, red); analogWrite(greenPin, green); analogWrite(bluePin, blue); }
Using it with Raspberry PI
Connect the IN1, IN2, and IN3 led pins to any of the digital ports for the Raspberry PI board (marked yellow in the above picture). Connect the GND led pin to a Ground Raspberry PI port (marked black in the above picture) – or use a breaboard to get more ground ports.
Source code (Phyton) is below.
#!/usr/bin/env python import time import os import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.OUT) GPIO.setup(17, GPIO.OUT) GPIO.setup(21, GPIO.OUT) while True: GPIO.output(4, True) time.sleep(0.5) GPIO.output(4, False) time.sleep(0.5) GPIO.output(17, True) time.sleep(0.5) GPIO.output(17, False) time.sleep(0.5) GPIO.output(21, True) time.sleep(0.5) GPIO.output(21, False) time.sleep(0.5)
Leave a reply
Returns and Exchanges
There are a few important things to keep in mind when returning a product you purchased.You can return unwanted items by post within 7 working days of receipt of your goods.
- You have 14 calendar days to return an item from the date you received it.
- Only items that have been purchased directly from Us.
- Please ensure that the item you are returning is repackaged with all elements.
Ship your item back to Us
Firstly Print and return this Returns Form to:
30 South Park Avenue, San Francisco, CA 94108, USA
Please remember to ensure that the item you are returning is repackaged with all elements.
For more information, view our full Returns and Exchanges information.
Reviews
There are no reviews yet.