rockblock_send_text.py
1 # pylint: disable=wrong-import-position 2 import time 3 4 # CircuitPython / Blinka 5 import board 6 7 uart = board.UART() 8 uart.baudrate = 19200 9 10 # via USB cable 11 # import serial 12 # uart = serial.Serial("/dev/ttyUSB0", 19200) 13 14 from adafruit_rockblock import RockBlock 15 16 rb = RockBlock(uart) 17 18 # set the text 19 rb.out_text = "hello world" 20 21 # try a satellite Short Burst Data transfer 22 print("Talking to satellite...") 23 status = rb.satellite_transfer() 24 # loop as needed 25 retry = 0 26 while status[0] > 8: 27 time.sleep(10) 28 status = rb.satellite_transfer() 29 print(retry, status) 30 retry += 1 31 32 print("\nDONE.")