# Axidraw p5 clean webusb interface

**URL:** <https://discourse.processing.org/t/axidraw-p5-clean-webusb-interface/5689>\
**Category:** Development\
**Created:** [November 18, 2018, 6:57pm UTC](https://discourse.processing.org/t/axidraw-p5-clean-webusb-interface/5689 "2018-11-18T18:57:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TiborUdvari](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiborudvari/32/18018_2.png) [@TiborUdvari](https://discourse.processing.org/u/TiborUdvari)\
**Post date:** [November 18, 2018, 6:57pm UTC](https://discourse.processing.org/t/axidraw-p5-clean-webusb-interface/5689/1 "2018-11-18T18:57:37Z")

</div>

I’m looking to create an API to control my [axidraw](https://axidraw.com/) through [WebUSB](https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web) (currently only working on Chrome) with p5. The communication works by sending simple serial messages. My idea is to have the usual functions like `line` , `ellipse` etc. behave normally, but in a certain state draw with the drawing machine instead of to the canvas.

I know this might be out of the scope of the general codebase, but I was wondering what would be a good entry point into the API as I would like to publish it as an optional addon/extensions to p5. I have thought of creating function decorators to the existing library with a global switch to toggle using the Axidraw.

I think ideally it would function something like a custom renderer class, that doesn’t actually render anything on the screen. But again, I don’t know how that would work, since I don’t know if that would work with the paradigm since drawing with the physical machine would mean taking a significant time for each action.

Do you have any ideas on the subject?

---

<div class="post-metadata">

**Author:** ![b2renger](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/b2renger/32/1283_2.png) [@b2renger](https://discourse.processing.org/u/b2renger)\
**Post date:** [December 8, 2019, 9:08pm UTC](https://discourse.processing.org/t/axidraw-p5-clean-webusb-interface/5689/2 "2019-12-08T21:08:10Z")

</div>

@TiborUdvari : did you start some code on this subject ? I am planning on working with an axidraw soon I intend to do it with p5js.

I was thinking about using a serial communication with : [https://github.com/p5-serial/p5.serialcontrol](https://github.com/p5-serial/p5.serialcontrol)  
and [https://github.com/p5-serial/p5.serialport](https://github.com/p5-serial/p5.serialport)

Anyhow if you have started something I would love to see how it works, and probably try to contribute.

Cheers
