transmit_fixed_length.py 492 B

12345678910111213141516
  1. import logging
  2. import cc1101
  3. logging.basicConfig(level=logging.INFO)
  4. with cc1101.CC1101() as transceiver:
  5. transceiver.set_base_frequency_hertz(433.5e6)
  6. transceiver.set_symbol_rate_baud(600)
  7. transceiver.set_sync_mode(cc1101.SyncMode.NO_PREAMBLE_AND_SYNC_WORD)
  8. transceiver.set_packet_length_mode(cc1101.PacketLengthMode.FIXED)
  9. transceiver.set_packet_length_bytes(4)
  10. transceiver.disable_checksum()
  11. print(transceiver)
  12. transceiver.transmit(b"\xff\x00\xaa\xff")