# RGB LED Wireling Rainbow example:
# This example shows how to create a single pixel with a specific color channel
# order and go through a color feature displaying the rainbow
# Library by: Adafruit
# Hardware by: TinyCircuits

import time
import board
import neopixel
import tinycircuits_wireling

wireling = tinycircuits_wireling.Wireling()  # Enables power to Pi Hat

# Configure the setup
PIXEL_PIN = wireling.getBoardPin(
    1)  # getBoardPin() returns the pin correlating to the input port
ORDER = neopixel.GRB  # pixel color channel order
COLOR = (255, 255, 0)  # color to blink
CLEAR = (0, 0, 0)  # clear (or second color)
DELAY = 0.2  # blink rate in seconds
BRIGHT = 0.125  # brightness

# Colors
RED = (255, 0, 0)
ORANGE = (255, 69, 0)
YELLOW = (255, 255, 0)
GREEN = (0, 255, 0)
GRN_BLU = (0, 255, 30)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)
PINK = (215, 0, 31)
Пример #2
0
# This example shows how to create a single RGB with a specific color channel
# order and blink it.
# Library by: Adafruit
# Hardware by: TinyCircuits

import time
import board
import neopixel
import tinycircuits_wireling

wireling = tinycircuits_wireling.Wireling()

# Configure the setup
RGB_PIN = wireling.getBoardPin(1)
ORDER = neopixel.GRB  # pixel color channel order
COLOR = (150, 0, 150)  # color to blink: purple
CLEAR = (0, 0, 0)  # clear (or second color)
DELAY = 1  # blink rate in seconds

# Create the RGB Wireling object using neopixel library
pixel = neopixel.NeoPixel(RGB_PIN, 1, pixel_order=ORDER)

# Loop forever and blink the color
while True:
    pixel[0] = COLOR
    time.sleep(DELAY)
    pixel[0] = CLEAR
    time.sleep(DELAY)
Пример #3
0
# Author: Laverena Wienclaw for TinyCircuits

# Import all board pins.
import time
import board
import busio
from digitalio import DigitalInOut
from PIL import Image, ImageDraw, ImageFont
import adafruit_ssd1306

# Create the I2C interface.
i2c = busio.I2C(board.SCL, board.SDA)

import tinycircuits_wireling

wireling = tinycircuits_wireling.Wireling()  # Enable and power Wireling Pi Hat

port = 0  # IMPORTANT: Select ports 0-3
reset_pin = DigitalInOut(
    wireling.getBoardPin(port))  # A reset line to reset circuitry
wireling.selectPort(port)

# Create the SSD1306 OLED class.
# The first two parameters are the pixel width and pixel height.  Change these
# to the right size for your display!
# The I2C address for these displays is 0x3d or 0x3c, change to match
# A reset line may be required if there is no auto-reset circuitry
display = adafruit_ssd1306.SSD1306_I2C(72, 40, i2c, addr=0x3c,
                                       reset=reset_pin)  # 0.42" Screen
#display = adafruit_ssd1306.SSD1306_I2C(96, 16, i2c, addr=0x3c, reset=reset_pin) # 0.69" Screen
#display = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3c, reset=reset_pin) # 0.96" Screen