To use Runestone on Lightning port-equipped iOS devices (currently all iPhones and many iPad models), you will need an iOS Lightning to USB adapter such as Apple's official “camera connection” adapter or a similar cable available in the Adafruit shop…
Recent iPads use USB C instead of the Lightning connector, and a common USB C-to-C or C-to-micro-B cable can be used.
Unlike the USB on a computer, which typically has a maximum current of 500ma on USB 2.0 ports, Apple iOS devices will only deliver a maximum of 100ma before the device disables power output to the port.
Adafruit boards that are running the latest CircuitPython should advertise that they are not over the 100ma threshold. However, when they go into bootloader mode, they may advertise that they use 500ma, which will cause the iOS device to shutdown the port.
If you have this issue or you have peripherals attached to your board that draw a large amount of current, such as a bunch of Neopixels, you may also need a powered USB hub to get around this limitation. This allows you to power higher current devices without exceeding the 100ma limit.
You will need to install CircuitPython onto your board ahead of time using a computer because iOS currently throws an error if you attempt to install CircuitPython.
Example Usage
If your code.py file contained the following code to blink the on-board LED and you wanted to slow the LED down, here's how you would go about doing that.
import time import board import digitalio led = digitalio.DigitalInOut(board.LED) led.switch_to_output(value=False) while True: led.value = not led.value time.sleep(0.5)
Once you have the board running CircuitPython connected, a drive called CIRCUITPY should appear in the list of locations.
If you are editing on an iPhone device, the interface is a bit more compact. When you first start up the app, you may need to make sure you are on Browse and hit the Back link a few times to get to locations where you can select the CIRCUITPY drive.
Select the drive and a list of files on the drive should appear. Then select file that you would like to edit. In this example it would be code.py.
Tap next to the 0.5 inside of the time.sleep()
function and change the value to 1.0. To save and reload the running program, press the Done link in the upper lefthand corner.
Now the LED should be waiting for one after turning on or off for a total of two seconds between blinks.
Page last edited March 08, 2024
Text editor powered by tinymce.