transmit.py 667 B

123456789101112131415161718192021
  1. import logging
  2. import time
  3. import cc1101
  4. logging.basicConfig(level=logging.INFO)
  5. with cc1101.CC1101() as transceiver:
  6. print("defaults:", transceiver)
  7. transceiver.set_base_frequency_hertz(433.5e6)
  8. transceiver.set_symbol_rate_baud(600)
  9. print(transceiver)
  10. print("state", transceiver.get_marc_state().name)
  11. print("base frequency", transceiver.get_base_frequency_hertz(), "Hz")
  12. print("symbol rate", transceiver.get_symbol_rate_baud(), "Baud")
  13. print("modulation format", transceiver.get_modulation_format().name)
  14. print("starting transmission")
  15. while True:
  16. transceiver.transmit(list(range(1, 32)))
  17. time.sleep(2.0)