0

Web USB on Trinket
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Web USB on Trinket

by tinkeringtech on Tue Feb 13, 2018 12:23 am

Hi,

Is there a special bootloader that's needed to play around with web USB (i.e with the web USB descriptor exposed) on the Trinket M0?
Or is this something with the .uf2?

Thanks.

tinkeringtech
 
Posts: 77
Joined: Wed Nov 23, 2011 10:08 pm

Re: Web USB on Trinket

by danhalbert on Sat Feb 17, 2018 12:26 pm

(Answered in chat)

danhalbert
 
Posts: 1418
Joined: Tue Aug 08, 2017 12:37 pm

Re: Web USB on Trinket

by tinkeringtech on Sun Feb 18, 2018 10:48 pm

Hi,

Thanks to Dan's assistance, I managed to get the Trinket M0 to work with webusb on makecode.

I re-built the Trinket M0 bootloader that has webusb support by cloning https://github.com/adafruit/uf2-samd21 and do make BOARD=trinket_m0
Then just drag the generated update-bootloader-trinket_m0-v1.23.1-adafruit.2-22-gae5806e.uf2 to the Trinket M0 in windows (via USB) and that updated the bootloader.

I then went to the Beta makecode webpage and paired the board.
trinket_paired.JPG
trinket_paired.JPG (51.88 KiB) Viewed 521 times

https://makecode.adafruit.com/beta?webusb=1#editor

Ran a test sketch with a 12 neopixel ring and it worked!
The pin mapping needs to be adjusted slightly as pin A2 on CPX = A4 on Trinket M0
makecode_trinketm0.JPG
makecode_trinketm0.JPG (62.73 KiB) Viewed 521 times


Pretty cool to see other boards coming into the webusb fold.

tinkeringtech
 
Posts: 77
Joined: Wed Nov 23, 2011 10:08 pm

Re: Web USB on Trinket

by jallwine on Wed Jan 02, 2019 6:29 pm

Is there a way to get WebUSB working with the Arduino IDE on the Trinket M0? I'm unable to get the examples working from here: https://github.com/webusb/arduino

The Trinket doesn't show up as a supported device in the browser after successfully uploading the sketches.

jallwine
 
Posts: 2
Joined: Wed Feb 21, 2018 12:59 pm

Re: Web USB on Trinket

by jallwine on Thu Jan 03, 2019 11:13 am

jallwine wrote:Is there a way to get WebUSB working with the Arduino IDE on the Trinket M0? I'm unable to get the examples working from here: https://github.com/webusb/arduino

The Trinket doesn't show up as a supported device in the browser after successfully uploading the sketches.


Looks like it was simply a matter of adding a filter to the demo's JavaScript to match the Trinket M0: https://github.com/webusb/arduino/blob/ ... ial.js#L13

It all worked after adding this line to the end of that list:
Code: Select all | TOGGLE FULL SIZE
{ 'vendorId': 0x239a, 'productId': 0x801e }

jallwine
 
Posts: 2
Joined: Wed Feb 21, 2018 12:59 pm

Please be positive and constructive with your questions and comments.