Skip to content

IR learning guides have ones and zeros swapped #2813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
pulseout = pulseio.PulseOut(board.IR_TX, frequency=38000, duty_cycle=2 ** 15)

# 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],
encoder = adafruit_irremote.GenericTransmit(header=[9000, 4500],
one=[560, 1700],
zero=[560, 560],
trail=0)

while True:
Expand Down
6 changes: 4 additions & 2 deletions Circuit_Playground_Express_IR_Zombie_Game/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
# Create a 'pulseio' output, to send infrared signals on the IR transmitter @ 38KHz
pulseout = pulseio.PulseOut(board.IR_TX, frequency=38000, duty_cycle=2 ** 15)
# Create an encoder that will take numbers and turn them into NEC IR pulses
encoder = adafruit_irremote.GenericTransmit(header=[9500, 4500], one=[550, 550],
zero=[550, 1700], trail=0)
encoder = adafruit_irremote.GenericTransmit(header=[9000, 4500],
one=[560, 1700],
zero=[560, 560],
trail=0)

# Set between 0 and 1 to set LED pulse speed. Smaller numbers are slower.
healer_led_pulse = 0.008
Expand Down
6 changes: 4 additions & 2 deletions Circuit_Playground_Express_and_IR/CPX_IR_CPX_transmit/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
# Create a 'pulseio' output, to send infrared signals on the IR transmitter @ 38KHz
pulseout = pulseio.PulseOut(board.IR_TX, frequency=38000, duty_cycle=2 ** 15)
# Create an encoder that will take numbers and turn them into NEC IR pulses
encoder = adafruit_irremote.GenericTransmit(header=[9500, 4500], one=[550, 550],
zero=[550, 1700], trail=0)
encoder = adafruit_irremote.GenericTransmit(header=[9000, 4500],
one=[560, 1700],
zero=[560, 560],
trail=0)

while True:
if cpx.button_a:
Expand Down
6 changes: 3 additions & 3 deletions IrRobotControl/glove/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
pulseout = pulseio.PulseOut(board.IR_TX, frequency=38000, duty_cycle=2 ** 15)

# 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],
encoder = adafruit_irremote.GenericTransmit(header=[9000, 4500],
one=[560, 1700],
zero=[560, 560],
trail=0)

def log(s):
Expand Down
9 changes: 5 additions & 4 deletions STEMMA_IR_LED_Emitter/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
# Create a 'PulseOut' to send infrared signals on the IR transmitter @ 38KHz
pulseout = pulseio.PulseOut(board.D5, frequency=38000, duty_cycle=2**15)
# Create an encoder that will take numbers and turn them into NEC IR pulses
emitter = adafruit_irremote.GenericTransmit(
header=[9500, 4500], one=[550, 550], zero=[550, 1700], trail=0
)
encoder = adafruit_irremote.GenericTransmit(header=[9000, 4500],
one=[560, 1700],
zero=[560, 560],
trail=0)

# count variable
count = 0

while True:
# send IR pulse
emitter.transmit(pulseout, [255, 2, 255, 0])
encoder.transmit(pulseout, [255, 2, 255, 0])
# increase count
count += 1
# print to REPL
Expand Down