example.py 610 B

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