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

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

### 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** :

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


## 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)
### 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)
### 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 M0 Express

[Adafruit Feather M0 Express](https://www.adafruit.com/product/3403)
At the Feather M0's heart is an ATSAMD21G18 ARM Cortex M0+ processor, clocked at 48 MHz and at 3.3V logic, the same one used in the new&nbsp;[Arduino Zero](https://www.adafruit.com/products/2843). This chip has a whopping 256K of FLASH (8x more than the Atmega328 or 32u4) and...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3403)
[Related Guides to the Product](https://learn.adafruit.com/products/3403/guides)
### Adafruit METRO M0 Express - designed for CircuitPython

[Adafruit METRO M0 Express - designed for CircuitPython](https://www.adafruit.com/product/3505)
Metro is our series of microcontroller boards for use with the Arduino IDE. This new **Metro M0 Express** board looks a whole lot like our&nbsp;[original Metro 328](https://www.adafruit.com/product/2488), but with a huge upgrade. Instead of the ATmega328, this Metro...

In Stock
[Buy Now](https://www.adafruit.com/product/3505)
[Related Guides to the Product](https://learn.adafruit.com/products/3505/guides)
### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

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

## Related Guides

- [Adafruit Feather M0 Express](https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-circuitpython.md)
- [Adafruit Metro M0 Express](https://learn.adafruit.com/adafruit-metro-m0-express.md)
- [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)
- [Adafruit PyPortal - IoT for CircuitPython](https://learn.adafruit.com/adafruit-pyportal.md)
- [Introducing Adafruit PyGamer](https://learn.adafruit.com/adafruit-pygamer.md)
- [Adafruit MONSTER M4SK](https://learn.adafruit.com/adafruit-monster-m4sk-eyes.md)
- [CircuitPython Essentials](https://learn.adafruit.com/circuitpython-essentials.md)
- [Making oscilloscope images with DACs](https://learn.adafruit.com/dac-oscilloscope-images.md)
- [MIDI Melody Maker](https://learn.adafruit.com/midi-melody-maker.md)
- [Cam Follower Automaton](https://learn.adafruit.com/cam-follower-automaton.md)
- [Using Python on Windows 10](https://learn.adafruit.com/using-python-on-windows-10.md)
- [CircuitPython Snow Globe](https://learn.adafruit.com/circuitpython-snow-globe.md)
- [Circuit Playground Express Compass](https://learn.adafruit.com/circuit-playground-express-compass.md)
- [Slider Crank Mechanism -- from Cardboard and Craft Sticks](https://learn.adafruit.com/cardboard-slider-crank.md)
- [Pushrod Garage](https://learn.adafruit.com/pushrod-garage.md)
- [Arcade Button Control Box](https://learn.adafruit.com/arcade-button-control-box.md)
- [A CLI in CircuitPython](https://learn.adafruit.com/a-cli-in-circuitpython.md)
- [PyPortal Case](https://learn.adafruit.com/pyportal-case.md)
- [Make It Glow - Your First NeoPixel Project](https://learn.adafruit.com/make-it-glow-your-first-neopixel-project.md)
- [Animatronic Glowing Medusa Headdress](https://learn.adafruit.com/animatronic-glowing-medusa-headdress.md)
- [Playing Arduboy Games on Arcada](https://learn.adafruit.com/playing-arduboy-games-on-arcada.md)
