# Circuit Playground Express on mobile devices

**URL:** <https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799>\
**Category:** Adafruit Circuit Playground Express\
**Created:** [November 19, 2019, 1:28am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799 "2019-11-19T01:28:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [November 19, 2019, 1:28am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/1 "2019-11-19T01:28:20Z")

</div>

In trying to use a CPX as a USB HID device on an iPhone or iPad, I’m getting this error:  
“CANNOT USE ACCESSORY  
CPlay Express (app): This accessory requires too much power.”

I believe there is a USB report descriptor that can be set to a value that makes the phone/tablet happy, as I’ve had Circuit Playground Express running CircuitPython code in the past.

You can see the different reports on a Mac in System Report for a Circuit Playground Express running MakeCode vs. CircuitPython, on the MakeCode board there is a “Current Required (mA):500” line that may be causing the problem.

Running MakeCode:

```
CPlay Express (app):
Product ID:	0x2402
Vendor ID:	0x03eb (Atmel Corporation)
Version:	42.02
Serial Number:	1318705658
Speed:	Up to 12 Mb/sec
Manufacturer:	CPlay Express (app)
Location ID:	0x14100000 / 10
Current Available (mA):	500
Current Required (mA):	500
Extra Operating Current (mA):0

```

Running CircuitPython:

```
CircuitPlayground Express:

 Product ID:0x8019
 Vendor ID:0x239a
 Version:1.00
 Serial Number:8E1438657525D4050213E25354D1E0FF
 Speed:Up to 12 Mb/sec
 Manufacturer:Adafruit Industries LLC
 Location ID:0x14100000 / 14
 Current Available (mA):500
 Extra Operating Current (mA):0
```

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [November 19, 2019, 3:41am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/2 "2019-11-19T03:41:21Z")

</div>

Update, this was fixed at one point before: [https://github.com/microsoft/pxt-adafruit/issues/837](https://github.com/microsoft/pxt-adafruit/issues/837) but seems broken now. I tried in release and Beta MakeCode.  
Most recently:

```
Adafruit Circuit Playground Express version: 1.5.12
Microsoft MakeCode version: 5.28.24
codal-circuit-playground runtime version: v2.0.1

```

Phone is iPhone X running iOS 13.2.3

Apple brand Lightning to USB adapter and a known good USB cable.

Code I’m running on the Circuit Playground Express:

```
input.buttonA.onEvent(ButtonEvent.Click, function () {
    keyboard.type("a")
})
```

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [November 19, 2019, 5:47am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/3 "2019-11-19T05:47:18Z")

</div>

The HID driver was contributed by Adafruit. Do you know who is the maintainer on the CircuitPython side? they might have a better idea of what’s going on.

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [November 19, 2019, 6:21am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/4 "2019-11-19T06:21:04Z")

</div>

I think this isn’t the HID driver, but the USB descriptor. Looks like it got changed back to 500mA here: [https://github.com/lancaster-university/codal-core/commit/36dafe77219239c1397ece44ed37a7f6e6f50d5a](https://github.com/lancaster-university/codal-core/commit/36dafe77219239c1397ece44ed37a7f6e6f50d5a) – the 250 value there is multiplied by 2mA, so 500mA which is more than the iPhone or iPad want to provide.

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [November 26, 2019, 3:28pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/5 "2019-11-26T15:28:43Z")

</div>

@mmoskal do you know if this can be adjusted back to a level that mobile devices will allow?

---

<div class="post-metadata">

**Author:** ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)\
**Post date:** [November 26, 2019, 5:47pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/6 "2019-11-26T17:47:18Z")

</div>

Yes, though it would be probably better to do it on the pxt side, not codal side. I would think that CPX can consume more than 100mA at peak, but maybe we’ll just ignore this…

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [November 26, 2019, 8:46pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/7 "2019-11-26T20:46:50Z")

</div>

OK, cool. What needs to be done to set this on the pxt side vs. codal?

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [December 2, 2019, 4:34pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/8 "2019-12-02T16:34:58Z")

</div>

@mmoskal anything we can do to get this updated?

---

<div class="post-metadata">

**Author:** ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)\
**Post date:** [December 8, 2019, 6:12pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/9 "2019-12-08T18:12:56Z")

</div>

I should be able to look at that this week

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [December 8, 2019, 7:05pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/10 "2019-12-08T19:05:13Z")

</div>

Terrific, thanks very much!

---

<div class="post-metadata">

**Author:** ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)\
**Post date:** [December 13, 2019, 5:07pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/11 "2019-12-13T17:07:39Z")

</div>

PR [https://github.com/lancaster-university/codal-core/pull/109](https://github.com/lancaster-university/codal-core/pull/109)

Once merged, codal needs to be tagged, and bumped in various PXT targets.

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [December 17, 2019, 4:42pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/12 "2019-12-17T16:42:17Z")

</div>

Excellent, thanks so much!

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [January 2, 2020, 4:41pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/13 "2020-01-02T16:41:41Z")

</div>

@mmoskal What does the timeframe of codal being tagged and bumped in the PXT targets look like? Circuit Playground Express still causes the same error message on iOS so I’m guessing that hasn’t happened yet. Thanks.

---

<div class="post-metadata">

**Author:** ![Canalesjac](https://avatars.discourse-cdn.com/v4/letter/c/bc79bd/32.png) [@Canalesjac](https://forum.makecode.com/u/Canalesjac)\
**Post date:** [January 16, 2020, 4:48am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/14 "2020-01-16T04:48:49Z")

</div>

I also wished it was easier to code on mobile devices with cpx. With microbit I like how you can use Bluetooth to wirelessly update your code. 🙂

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [January 17, 2020, 4:53am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/15 "2020-01-17T04:53:04Z")

</div>

I’ve pushed the update to the beta - v1.5.19

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [January 20, 2020, 6:41pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/16 "2020-01-20T18:41:40Z")

</div>

Excellent, thanks @peli I’ll try it out.

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [January 20, 2020, 6:52pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/17 "2020-01-20T18:52:08Z")

</div>

@peli @mmoskal this works great now, thank much.

---

<div class="post-metadata">

**Author:** ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)\
**Post date:** [January 21, 2020, 10:49pm UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/18 "2020-01-21T22:49:17Z")

</div>

@peli @mmoskal did something get rolled back? This no longer works. Using Circuit Playground Express version 1.5.20, MC version 5.32.3, codal-circuit-playground runtime 2.0.1  
It is reporting 500mA required on mac usb report and causing iPad to say accessory using too much power.  
There may be some cache of USB descriptors that iOS and mac os have, going to look into clearing those.  
UPDATE: restarting the mac did clear the cache which now reports current required as 100mA, but iPad still basically rejects it.

---

<div class="post-metadata">

**Author:** ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)\
**Post date:** [January 22, 2020, 12:17am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/19 "2020-01-22T00:17:43Z")

</div>

We did not rollback anymore. Not sure how to tell the iPad to clear the device cache.

---

<div class="post-metadata">

**Author:** ![kjw](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kjw](https://forum.makecode.com/u/kjw)\
**Post date:** [July 7, 2020, 10:57am UTC](https://forum.makecode.com/t/circuit-playground-express-on-mobile-devices/799/20 "2020-07-07T10:57:28Z")

</div>

BTW, there’s a question about errors using an iPad on [StackOverflow: [Trying to use Circuit Playground Express with iPad - CPLAYBOOT USB partition disappears due to “No valid file provider found”](https://stackoverflow.com/questions/62766748/trying-to-use-circuit-playground-express-with-ipad-cplayboot-usb-partition-dis).
