# Program CircuitPython USB Devices with iPhone & iPad

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/081/508/medium800/circuitpython_cirpy-plus-iphone.jpg?1569547659)

With the launch of **iOS** & **iPadOS 13** , iPhone and iPad now have the ability to **edit code** on **CircuitPython**  **USB**  **devices.** &nbsp;Users can connect a board such as&nbsp;[Circuit Playground Express](https://www.adafruit.com/product/3333)&nbsp;to their mobile device and edit & run code on the go.

For this guide, we'll be using a [Circuit Playground Express](https://www.adafruit.com/product/3333), but the process should work with any of **Adafruit's CircuitPython USB devices** - click [here for a full list](https://circuitpython.org/downloads?manufacturers=Adafruit).

## What you'll need

• An&nbsp; **iPhone** capable of running **iOS 13** or **iPad** capable of running **iPadOS.** Check your device's&nbsp;[compatibility here](https://support.apple.com/ios/update).

Info: 

Featured
### 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)
![A Black woman's manicured hand holds a round microcontroller with lit up LEDs.](https://cdn-shop.adafruit.com/640x480/3333-05.jpg)

Featured
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

If you're using an **iPad Pro** equipped with a **USB-C port** , skip the Lightning Adapter & USB A to Micro-B cable and simply use a **USB-C to Micro-B cable** :

Featured
### USB C to Micro B Cable - 1 ft 0.3 meter

[USB C to Micro B Cable - 1 ft 0.3 meter](https://www.adafruit.com/product/3879)
As technology changes and adapts, so does Adafruit! Rather than the regular USB A, this cable has&nbsp; **USB C to Micro B** &nbsp;plugs!

USB C is the latest industry-standard connector for transmitting data _and_ power. Like Lightning and MagSafe cables, USB C has no...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3879)
[Related Guides to the Product](https://learn.adafruit.com/products/3879/guides)
![USB C to Micro B Cable. 1ft 0.3 meters.](https://cdn-shop.adafruit.com/640x480/3879-02.jpg)

# Program CircuitPython USB Devices with iPhone & iPad

## Preparation

First, let's check to make sure your CircuitPython & Apple devices are ready to talk to eachother.

## Update CircuitPython

At the time of this writing **iOS** & **iPadOS** have been tested and confirmed to work with **CircuitPython**  **version**  **4.1.0**.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/503/medium800/circuitpython-4.1.0-check.jpg?1569542187)

Connect your CircuitPython compatible device to your **computer** (_not_ the iOS device), and open the **boot\_out.txt** file and check what **version** of CircuitPython you're running.&nbsp;

If you don't see a file named **boot\_out.txt** &nbsp;or you have an **older (than 4.1.0)** or **alpha** version of CircuitPython installed, update to the [latest stable release using these instructions](https://learn.adafruit.com/circuit-playground-express-circuitpython-5-minute-guide/update-circuitpython).

## Update iOS/iPadOS
![](https://cdn-learn.adafruit.com/assets/assets/000/081/507/medium800/circuitpython_iOS-version.jpg?1569547308)

On your **iPhone/iPad** , check what **version OS** you're running by opening the **Settings** app and tapping **General** -\> **About** and checking the **Software Version** number.

If your version number is **13 or later** , you’re good to go. If not, update your OS via&nbsp; **Settings** -\> **General** -\> **Software Update**.&nbsp;

## **Connect CircuitPython device to iPhone/iPad**
For devices with a **Lightning** connector – connect your&nbsp; **Lightning to USB Adapter** &nbsp;to&nbsp; **iPhone/iPad** &nbsp;and connect your&nbsp; **CircuitPython device** &nbsp;to the adapter via a&nbsp; **micro USB cable**.

For devices with a **USB-C** connector –&nbsp;connect your&nbsp; **CircuitPython device** directly to your **iPad** using a **USB-C to Micro-B cable.**

# Program CircuitPython USB Devices with iPhone & iPad

## Copy, Edit, Paste

Info: 

## **Copy code from CIRCUITPY drive**
Plug your CircuitPython board, via USB, to your iDevice using the appropriate cable.

On your iDevice, open the&nbsp; **Files** &nbsp;app, and tap on the drive labelled&nbsp; **CIRCUITPY**. Locate the&nbsp; **code.py** &nbsp;file within. Tap and hold on&nbsp; **code.py** &nbsp;and choose&nbsp; **Copy** &nbsp;from the menu.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/499/medium800/circuitpython_step-copy_code.py.jpg?1569539168)

## **Paste code to internal storage**
Next in the&nbsp; **Files** &nbsp;app, navigate back and tap&nbsp; **On My iPhone/On My iPad**.

**Tap and hold** on an empty area, and choose&nbsp; **Paste** &nbsp;from the menu.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/500/medium800/circuitpython_step-paste_code.py.jpg?1569539195)

## **Edit code**
Open the&nbsp; **App Store** &nbsp;and search for the **free** app named&nbsp;[Koder Code Editor](https://apps.apple.com/us/app/koder-code-editor/id1447489375#?platform=iphone)&nbsp;and **download/install** it.

Open&nbsp; **Koder** &nbsp;and tap the&nbsp; **new file icon** &nbsp;in the lower left hand corner, tap&nbsp; **Open Other App’s Files** , then open the&nbsp; **internal** &nbsp;copy of&nbsp; **code.py** &nbsp;stored in&nbsp; **On My iPhone/On My iPad**.

**Make changes** to your code, then **close** the file – it will be **saved automatically**.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/501/medium800/circuitpython_step-edit_w_koder.jpg?1569539224)

## **Overwrite original code.py on CIRCUITPY**
Return to the&nbsp; **Files** &nbsp;app and navigate to&nbsp; **On My iPhone/On My iPad.** &nbsp; **Tap and hold** on the edited&nbsp; **code,py** &nbsp;file, and choose&nbsp; **Copy** &nbsp;from the menu.

Navigate to the&nbsp; **CIRCUITPY** &nbsp;drive, **tap and hold** in a blank area, choose&nbsp; **Paste** &nbsp;from the menu, and then choose&nbsp; **Replace** &nbsp;from the popup that appears.

![](https://cdn-learn.adafruit.com/assets/assets/000/081/502/medium800/circuitpython_step-paste_code.py.jpg?1569539249)

## Done

After a few seconds, your **CircuitPython**  **device** should restart and begin **running** your **new**  **code**. That’s all there is to it - enjoy the world of mobile embedded development!

# Program CircuitPython USB Devices with iPhone & iPad

## Troubleshooting

### 

Your CircuitPython device may periodically restart while being powered by iPhone or iPad – for continuous operation, connect your board to a dedicated power source using the battery port.

### 

Please check to ensure your running the **latest 4.x stable** release of CircuitPython by following [these steps](https://learn.adafruit.com/circuit-playground-express-circuitpython-5-minute-guide/update-circuitpython).

If your project **requires** CircuitPython **5.0.0 or later** and you wish to edit your code on iOS/iPadOS follow these steps:

1. Connect your CircuitPython device to your computer
2. Open the CIRCUITPY drive (press **CMD** + **Shift** + **period** to view hidden files on macOS)
3. Delete the file named **.Trashes**

You should now be able to delete and replace files on your CircuitPython device from iOS/iPadOS.

CircuitPython 5.0.0 uses a file named .Trashes which is hidden by default on macOS. This file prevents macOS from storing deleted files on the CIRCUITPY drive before the system trash is emptied – helping to conserve the limited storage space of CircuitPython devices. Currently, the iOS Files app is incompatible with this technique, and presence of the file prevents deletion of any other file on the CIRCUITPY drive.

### 

Check to ensure your Apple device is running iOS or iPadOS **13** or later. If not, please update your device.

### 

Manufacturer designs vary, so we **can't guarantee**  **every hub** will work for connecting to iPhone/iPad to your CircuitPython device. That being said, we didn't have any issues with the USB hubs we tested - so your hub will likely work as well.


## Guide 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)
### 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)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
### USB C to Micro B Cable - 1 ft 0.3 meter

[USB C to Micro B Cable - 1 ft 0.3 meter](https://www.adafruit.com/product/3879)
As technology changes and adapts, so does Adafruit! Rather than the regular USB A, this cable has&nbsp; **USB C to Micro B** &nbsp;plugs!

USB C is the latest industry-standard connector for transmitting data _and_ power. Like Lightning and MagSafe cables, USB C has no...

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

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Pathfinder Robot Companion](https://learn.adafruit.com/pathfinder.md)
- [Weather Wise Wifi Umbrella Stand](https://learn.adafruit.com/weather-wise-wifi-umbrella-stand.md)
- [Crickit Powered Maker Ice Cream Truck!](https://learn.adafruit.com/crickit-maker-ice-cream-truck.md)
- [Circuit Playground Express Perk-up Ears](https://learn.adafruit.com/perk-up-ears.md)
- [Spy Theme Playback Device](https://learn.adafruit.com/spy-theme-playback-device.md)
- [CLUE Custom CircuitPython Badge](https://learn.adafruit.com/clue-custom-circuit-python-badge.md)
- [PyPortal Weekly Countdown Clock](https://learn.adafruit.com/pyportal-countdown-clock.md)
- [New Year Countdown Clock with Circuit Playground Express](https://learn.adafruit.com/new-year-countdown-clock-with-circuit-playground-express.md)
- [A colorful CLUE slideshow purse with Bright Wearables](https://learn.adafruit.com/a-colorful-clue-slideshow-purse.md)
- [Capacitive Touch Pulsing Heart](https://learn.adafruit.com/3d-printed-heart-capacitive-touch.md)
- [Cardboard Window Skull With Animated LED Eyes](https://learn.adafruit.com/cardboard-window-skull-animated-led-eyes.md)
- [Infrared Hand Gesture Robot Control Glove](https://learn.adafruit.com/cpx-ir-infrared-hand-gesture-robot-control-glove.md)
- [Automatic Cat Treat Dispenser](https://learn.adafruit.com/automatic-cat-treat-dispenser.md)
- [Flashing LED Strand with MakeCode](https://learn.adafruit.com/flashing-led-strand-with-makecode.md)
- [RGB Matrix Automatic YouTube ON AIR Sign](https://learn.adafruit.com/rgb-matrix-automatic-youtube-on-air-sign.md)
