one treasure to rule them all...
This commit is contained in:
parent
0e9c2d068d
commit
d76748d0bc
3 changed files with 2 additions and 58 deletions
|
|
@ -5,8 +5,8 @@ import adafruit_irremote
|
|||
import neopixel
|
||||
|
||||
# Configure treasure information
|
||||
TREASURE_ID = 1
|
||||
TRANSMIT_DELAY = 15
|
||||
TREASURE_ID = 1 # CHANGE THIS NUMBER TO 2, 3, ETC, A UNIQUE NUMBER FOR EACH TREASURE!
|
||||
TRANSMIT_DELAY = 15 # change this as desired to affect game dynamics, or just leave as is
|
||||
|
||||
# Create NeoPixel object to indicate status
|
||||
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10)
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
import time
|
||||
import board
|
||||
import pulseio
|
||||
import adafruit_irremote
|
||||
import neopixel
|
||||
|
||||
# Configure treasure information
|
||||
TREASURE_ID = 2
|
||||
TRANSMIT_DELAY = 15
|
||||
|
||||
# Create NeoPixel object to indicate status
|
||||
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10)
|
||||
|
||||
# Create a 'pulseio' output, to send infrared signals on the IR transmitter @ 38KHz
|
||||
pwm = pulseio.PWMOut(board.IR_TX, frequency=38000, duty_cycle=2 ** 15)
|
||||
pulseout = pulseio.PulseOut(pwm)
|
||||
|
||||
# Create an encoder that will take numbers and turn them into IR pulses
|
||||
encoder = adafruit_irremote.GenericTransmit(header=[9500, 4500],
|
||||
one=[550, 550],
|
||||
zero=[550, 1700],
|
||||
trail=0)
|
||||
while True:
|
||||
pixels.fill(0xFF0000)
|
||||
encoder.transmit(pulseout, [TREASURE_ID]*4)
|
||||
time.sleep(0.25)
|
||||
pixels.fill(0)
|
||||
time.sleep(TRANSMIT_DELAY)
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
import time
|
||||
import board
|
||||
import pulseio
|
||||
import adafruit_irremote
|
||||
import neopixel
|
||||
|
||||
# Configure treasure information
|
||||
TREASURE_ID = 3
|
||||
TRANSMIT_DELAY = 15
|
||||
|
||||
# Create NeoPixel object to indicate status
|
||||
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10)
|
||||
|
||||
# Create a 'pulseio' output, to send infrared signals on the IR transmitter @ 38KHz
|
||||
pwm = pulseio.PWMOut(board.IR_TX, frequency=38000, duty_cycle=2 ** 15)
|
||||
pulseout = pulseio.PulseOut(pwm)
|
||||
|
||||
# Create an encoder that will take numbers and turn them into IR pulses
|
||||
encoder = adafruit_irremote.GenericTransmit(header=[9500, 4500],
|
||||
one=[550, 550],
|
||||
zero=[550, 1700],
|
||||
trail=0)
|
||||
while True:
|
||||
pixels.fill(0xFF0000)
|
||||
encoder.transmit(pulseout, [TREASURE_ID]*4)
|
||||
time.sleep(0.25)
|
||||
pixels.fill(0)
|
||||
time.sleep(TRANSMIT_DELAY)
|
||||
Loading…
Reference in a new issue