예제 #1
0
def one_left():
    with busio.I2C(board.SCL, board.SDA) as i2c:
        display = adafruit_is31fl3731.Matrix(i2c)
        display.pixel(8, 3, 50)
        display.pixel(9, 2, 50)
        display.pixel(9, 3, 50)
        display.pixel(9, 4, 50)
        display.pixel(9, 5, 50)
        display.pixel(10, 6, 50)
        display.pixel(9, 6, 50)
        display.pixel(8, 6, 50)
예제 #2
0
def one_right():
    with busio.I2C(board.SCL, board.SDA) as i2c:
        display = adafruit_is31fl3731.Matrix(i2c)
        display.pixel(13, 3, 50)
        display.pixel(14, 2, 50)
        display.pixel(14, 3, 50)
        display.pixel(14, 4, 50)
        display.pixel(14, 5, 50)
        display.pixel(15, 6, 50)
        display.pixel(14, 6, 50)
        display.pixel(13, 6, 50)
예제 #3
0
def seven_right():
    with busio.I2C(board.SCL, board.SDA) as i2c:
        display = adafruit_is31fl3731.Matrix(i2c)
        display.pixel(12, 2, 50)
        display.pixel(13, 2, 50)
        display.pixel(14, 2, 50)

        # display.pixel(8, 3, 50)
        # display.pixel(8, 4, 50)
        # display.pixel(9, 4, 50)

        display.pixel(14, 3, 50)
        display.pixel(14, 4, 50)
        display.pixel(14, 5, 50)
        display.pixel(14, 6, 50)
예제 #4
0
def six_right():
    with busio.I2C(board.SCL, board.SDA) as i2c:
        display = adafruit_is31fl3731.Matrix(i2c)

        # ....display.pixel(8, 2, 50)

        display.pixel(13, 2, 50)
        display.pixel(14, 2, 50)
        display.pixel(12, 3, 50)
        display.pixel(12, 4, 50)
        display.pixel(13, 4, 50)
        display.pixel(14, 4, 50)
        display.pixel(14, 5, 50)
        display.pixel(14, 6, 50)
        display.pixel(13, 6, 50)
        display.pixel(12, 6, 50)
        display.pixel(12, 5, 50)
예제 #5
0
    def __init__(self):
        self.i2c = busio.I2C(board.SCL, board.SDA)
        self.display = adafruit_is31fl3731.Matrix(self.i2c)
        #self.led_level = 255
        GPIO.setmode(GPIO.BCM)  #for light sensor
        self.a_pin = 18
        self.b_pin = 23

        self.pos_dict = {}
        counter = 0
        for x in range(
                0, 16):  #address the LED matrix to a int. 0={0,0},1={0,1}, etc
            for y in range(0, 9):
                self.pos_dict[counter] = {"x": x, "y": y}
                counter += 1
                self.display.pixel(x, y, 127)  #turn on LED at that possition.
                time.sleep(.01)
        #test LEDs
        self.display.fill(255)
        time.sleep(.2)
        self.display.fill(0)
        self.previous_hour_led = 0
        self.previous_min_led = 0
예제 #6
0
# The code borrows heavily from Tony DiCola's examples of using ADS1x15 with
# Raspberry pi and WorldFamousElectronics's code for PulseSensor_Amped_Arduino

# Author: Udayan Kumar
# License: Public Domain

import time
# Import the ADS1x15 module.
import Adafruit_ADS1x15
import board
import busio
import adafruit_is31fl3731
from threading import Thread
i2c = busio.I2C(board.SCL, board.SDA)

display = adafruit_is31fl3731.Matrix(i2c)

display.pixel(5, 3, 127, blink=True)
display.pixel(6, 3, 127, blink=True)
display.pixel(5, 4, 127, blink=True)
display.pixel(4, 4, 127, blink=True)
display.pixel(3, 4, 127, blink=True)
display.pixel(2, 3, 127, blink=True)
display.pixel(3, 3, 127, blink=True)
display.pixel(4, 5, 127, blink=True)
display.pixel(4, 3, 127, blink=True)
display.pixel(5, 2, 127, blink=True)
display.pixel(6, 2, 127, blink=True)
display.pixel(7, 3, 127, blink=True)
display.pixel(6, 4, 127, blink=True)
display.pixel(5, 5, 127, blink=True)
예제 #7
0
파일: code.py 프로젝트: nielsek/badge2020
import board, time, busio, adafruit_is31fl3731
from digitalio import DigitalInOut, Direction, Pull
import adafruit_framebuf

brightness = 40

i2c = busio.I2C(board.SCL, board.SDA)
sdb = DigitalInOut(board.SDB)
sdb.direction = Direction.OUTPUT
sdb.value = True
display1 = adafruit_is31fl3731.Matrix(i2c, address=0x74)
display2 = adafruit_is31fl3731.Matrix(i2c, address=0x77)

buf = bytearray(64)  # 2 bytes tall x 32 wide = 64 bytes (9 bits is 2 bytes)
fb = adafruit_framebuf.FrameBuffer(buf, display1.width * 2, display1.height,
                                   adafruit_framebuf.MVLSB)


def blit(frame):
    display1.frame(frame, show=False)
    display2.frame(frame, show=False)
    for x in range(display1.width):
        bite = buf[x]
        for y in range(display1.height):
            bit = 1 << y & bite
            if bit:
                display1.pixel(x, y, brightness)
        bite = buf[x + 16]
        for y in range(display2.height):
            bit = 1 << y & bite
            if bit:
예제 #8
0
 def power_up_logo():
     matrix = adafruit_is31fl3731.Matrix()
     matrix.fill(brightness =10)