This commit is contained in:
Kattni Rembor 2018-05-28 22:48:26 -04:00
parent 87c786caea
commit 0b0fd663a0
9 changed files with 17 additions and 16 deletions

View file

@ -2,6 +2,7 @@
# When used with the Adafruit NEC remote will act like a keyboard and
# type out keypresses.
import time
import adafruit_irremote
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
@ -9,7 +10,6 @@ from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
import adafruit_dotstar
import pulseio
import board
import time
led = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1)
@ -73,4 +73,3 @@ while True:
led[0] = (100, 0, 0) # flash red
print("Failed to decode: ", e.args)
print("----------------------------")

View file

@ -31,4 +31,3 @@ while True:
print("Failed to decode: ", e.args)
print("----------------------------")

View file

@ -3,7 +3,6 @@
import pulseio
import board
import time
import adafruit_dotstar
import adafruit_irremote

View file

@ -18,7 +18,7 @@ decoder = adafruit_irremote.GenericDecode()
pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=100, idle_state=True)
# Expected pulse, pasted in from previous recording REPL session:
key1_pulses = [0
key1_pulses = [0]
key2_pulses = [1]

View file

@ -1,5 +1,6 @@
# Animatronic Hand
# Binary Counting on four fingers up to 15
import time
from digitalio import DigitalInOut, Direction, Pull
import audioio
from adafruit_seesaw.seesaw import Seesaw
@ -7,7 +8,6 @@ from adafruit_seesaw.pwmout import PWMOut
from adafruit_motor import servo
from busio import I2C
import board
import time
# Create I2C and seesaw objuect
i2c = I2C(board.SCL, board.SDA)

View file

@ -8,6 +8,8 @@ import ntptime
import ubinascii
import uhashlib
# pylint: disable=broad-except
# https://github.com/pyotp/pyotp example
totp = [("Discord ", 'JBSWY3DPEHPK3PXP'),
("Gmail ", 'abcdefghijklmnopqrstuvwxyz234567'),

View file

@ -4,7 +4,7 @@ import time
import board
import pulseio
from digitalio import DigitalInOut, Direction, Pull
# pylint: disable=eval-used
# Switch to select 'stealth-mode'
switch = DigitalInOut(board.SLIDE_SWITCH)
switch.direction = Direction.INPUT

View file

@ -7,6 +7,8 @@ import board
import pulseio
from digitalio import DigitalInOut, Direction
# pylint: disable=eval-used
pixel = adafruit_dotstar.DotStar(
board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.2)
pixel.fill((0, 0, 0))

View file

@ -64,8 +64,8 @@ def servo_back(direction):
print("Its Stumble Bot Time")
while True:
if button_A.value: # If button A is pressed, start bot
led.value = True # Turn on LED 13 to show we're gone!
if button_A.value: # If button A is pressed, start bot
led.value = True # Turn on LED 13 to show we're gone!
for i in range(5):
print("back 1")
servo_back(1)