So you're up and running with a nifty CircuitPython board, but what can you connect to it to control hardware?  There are lots of guides on drivers that are ported from Arduino to CircuitPython, but what if you have hardware with no CircuitPython driver yet?  If you're willing to get your hands a bit dirty you can actually convert Arduino code to CircuitPython and Python without a lot of trouble.  Both languages support the same basic hardware access, and in fact with Python you might even find the driver code is simpler and easier to write and use.  This guide will explore how to port an Arduino driver for the VL6180X distance sensor to CircuitPython.  We'll walk through the entire process of converting and testing the Python driver code.

Before you get started you'll want to be aware that this is an advanced tutorial.  You'll want to be familiar with the structure and use of Arduino libraries and Arduino code in general.  You'll also want to be familiar with Python code, like the basics of control, loops, etc.  In addition it will greatly help to be familiar with CircuitPython code for talking to hardware--check out these guides:

Continue on to learn about the hardware used in this guide!

Last updated on 2017-10-16 at 05.31.09 PM Published on 2017-10-16 at 05.31.56 PM