# Edit CircuitPython Code on iOS with Runestone

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/111/480/medium800/circuitpython_IMG_4173.jpeg?1652226641)

Up to this point, editing code on CircuitPython devices has sometimes been tough to get set up and working. Some editors have trouble with not writing the code to the board immediately and cache it instead and some will just show everything as one color, making coding a little bit more difficult.&nbsp;

[Runestone](https://runestone.app/) is a streamlined and lightweight Text and Code Editor that runs on iOS devices such as the iPhone and iPad with color coding that supports [CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview). It is a free app, that has an option to unlock premium features such as line numbers, page guides, app icon customization, and displaying invisible characters.

Runestone does an excellent job of giving you exactly what you need in order to code on the go without too many bells and whistles which can make the learning curve much steeper. Although it doesn't have some features such as tabs, this works for CircuitPython because saving the file will cause the code to reload anyways. This guide should help get you up and running so you can start editing on iOS devices.

# Edit CircuitPython Code on iOS with Runestone

## Usage

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.

Warning: 

You will need to [install CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython) onto your board ahead of time using a computer because iOS currently throws an error if you attempt to install CircuitPython.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/475/medium800/circuitpython_IMG_0004.png?1652218907)

## 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.

```auto
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.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/477/medium800/circuitpython_IMG_0005.png?1652219172)

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.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/482/medium800/circuitpython_IMG_4175.png?1652227822)

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**.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/478/medium800/circuitpython_IMG_0006.png?1652221347)

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.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/489/medium800/circuitpython_IMG_0012.png?1652282271)

Now the LED should be waiting for one after turning on or off for a total of two seconds between blinks.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/490/medium800thumb/circuitpython_Blinking_LED.jpg?1652282871)


## Featured Products

### iOS Lightning to USB OTG Cable

[iOS Lightning to USB OTG Cable](https://www.adafruit.com/product/3940)
Your iOS phone or tablet may not have a USB port on the bottom but that doesn't mean you can't use it to connect USB devices. Secretly known as a 'Camera Connector' or 'MIDI Connector' cable, this doohicky plugs into the bottom of your iOs device and gives you a USB A...

In Stock
[Buy Now](https://www.adafruit.com/product/3940)
[Related Guides to the Product](https://learn.adafruit.com/products/3940/guides)
### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

In Stock
[Buy Now](https://www.adafruit.com/product/4111)
[Related Guides to the Product](https://learn.adafruit.com/products/4111/guides)
### Pink and Purple Woven USB A to USB C Cable - 1 meter long

[Pink and Purple Woven USB A to USB C Cable - 1 meter long](https://www.adafruit.com/product/5153)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also made for USB C for our modernized breakout boards, Feathers, and more.&nbsp;&nbsp;[If you want something just like it but for Micro B, we...](https://www.adafruit.com/product/4111)

Out of Stock
[Buy Now](https://www.adafruit.com/product/5153)
[Related Guides to the Product](https://learn.adafruit.com/products/5153/guides)
### USB 2.0 Powered Hub - 7 Ports with 5V 2A Power Supply

[USB 2.0 Powered Hub - 7 Ports with 5V 2A Power Supply](https://www.adafruit.com/product/961)
Add lots more USB capability to your Raspberry Pi or computer using this powered USB 2.0 hub. It adds a full **seven powered ports** , all at USB 2.0 speeds so you can use video cameras and other high speed devices (cheaper hubs are v1.1 and not as fast!)  
  
The extra sauce...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/961)
[Related Guides to the Product](https://learn.adafruit.com/products/961/guides)
### Adafruit Feather M4 Express - Featuring ATSAMD51

[Adafruit Feather M4 Express - Featuring ATSAMD51](https://www.adafruit.com/product/3857)
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox, half bird, OK?) This feather is powered by our new favorite chip, the **ATSAMD51J19** -&nbsp; with...

In Stock
[Buy Now](https://www.adafruit.com/product/3857)
[Related Guides to the Product](https://learn.adafruit.com/products/3857/guides)
### Adafruit Feather RP2040

[Adafruit Feather RP2040](https://www.adafruit.com/product/4884)
A new chip means a new Feather, and the Raspberry Pi RP2040 is no exception. When we saw this chip we thought "this chip is going to be awesome when we give it the Feather Treatment" and so we did! This Feather features the&nbsp; **RP2040** , and all niceties you know and...

In Stock
[Buy Now](https://www.adafruit.com/product/4884)
[Related Guides to the Product](https://learn.adafruit.com/products/4884/guides)
### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Adafruit Feather M4 Express](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51.md)
- [Introducing Adafruit Feather RP2040](https://learn.adafruit.com/adafruit-feather-rp2040-pico.md)
- [Adafruit VCNL4040 Proximity Sensor](https://learn.adafruit.com/adafruit-vcnl4040-proximity-sensor.md)
- [Makecode para la Circuit Playground Express](https://learn.adafruit.com/makecode-es.md)
- [Hacking Holiday Animatronics](https://learn.adafruit.com/hacking-holiday-animatronics.md)
- [CRICKIT Snake Bot](https://learn.adafruit.com/crickit-snake-bot.md)
- [Digital Fidget Spinner](https://learn.adafruit.com/digital-fidget-spinner.md)
- [Mystery Box: The Freefall Deck](https://learn.adafruit.com/mystery-box-freefall-deck.md)
- [Glitter Positioning System](https://learn.adafruit.com/glitter-positioning-system.md)
- [Capacitive Touch Pulsing Heart](https://learn.adafruit.com/3d-printed-heart-capacitive-touch.md)
- [Motorized Marble Machine](https://learn.adafruit.com/marble-run.md)
- [Crickit Powered Mini Chair Swing Ride!](https://learn.adafruit.com/mini-chair-swing-ride.md)
- [CircuitPython Essentials](https://learn.adafruit.com/circuitpython-essentials.md)
- [FLORAbrella](https://learn.adafruit.com/florabrella.md)
- [Circuit Playground Express: Piano de Limones](https://learn.adafruit.com/circuit-playground-express-piano-de-limones.md)
- [Make It Glow With Crickit](https://learn.adafruit.com/make-it-glow-with-crickit.md)
- [Cam Follower Automaton](https://learn.adafruit.com/cam-follower-automaton.md)
