example.py 541 B

12345678910111213141516171819
  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("modulation format", transceiver.get_modulation_format().name)
  12. print("starting transmission")
  13. while True:
  14. transceiver.transmit(list(range(1, 32)))
  15. time.sleep(2.0)