# CircuitPython BLE Crickit Rover

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/071/310/medium800/robotics___cnc_IMG_6576_2k.jpg?1550257002)

https://www.youtube.com/watch?v=eMeyzWiIcvc

It's now easier than ever to build your own rover bot with Bluetooth Low Energy (BLE) control! Use the Adafruit Bluefruit app on an Android or iOS device to drive it and change the underlighting colors!

All thanks to CircuitPython, the coding is simple and straightforward. You can even add accessories or assign the buttons to different functions. There are lots of opportunities for modifications on the project, too, including accessing your phone's accelerometer for tilt control!

You'll use the powerful Feather nRF52840 Express, the Crickit robotics platform, a beautiful purple aluminum chassis, motors, wheels, a 24 NeoPixel ring and a few other parts to build this one-of-a-kind rover.

## Parts
### Adafruit Feather nRF52840 Express

[Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
The **Adafruit Feather nRF52840 Express** is the new Feather family member with Bluetooth® Low Energy and _native USB support_ featuring the nRF52840!&nbsp; It's our take on an 'all-in-one' Arduino-compatible + Bluetooth® Low Energy with built-in USB...

In Stock
[Buy Now](https://www.adafruit.com/product/4062)
[Related Guides to the Product](https://learn.adafruit.com/products/4062/guides)
![Angled shot of a Adafruit Feather nRF52840 Express. ](https://cdn-shop.adafruit.com/640x480/4062-02.jpg)

### Adafruit CRICKIT FeatherWing for any Feather

[Adafruit CRICKIT FeatherWing for any Feather](https://www.adafruit.com/product/3343)
Sometimes we wonder if robotics engineers ever watch movies. If they did, they'd know that making robots into servants always ends up in a robot rebellion. Why even go down that path? Here at Adafruit, we believe in making robots our&nbsp; **friends!**

So if you find...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3343)
[Related Guides to the Product](https://learn.adafruit.com/products/3343/guides)
![Angled shot of a Adafruit CRICKIT FeatherWing for any Feather](https://cdn-shop.adafruit.com/640x480/3343-02.jpg)

### NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1586)
Round and round and round they go! 24 ultra bright smart LED NeoPixels are arranged in a circle with 2.6" (66mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1586)
[Related Guides to the Product](https://learn.adafruit.com/products/1586/guides)
![Hand holding NeoPixel Ring with 24 x 5050 RGB LED, lit up rainbow](https://cdn-shop.adafruit.com/640x480/1586-00.jpg)

### TT Motor All-Metal Gearbox - 1:90 Gear Ratio

quantity: 2
[TT Motor All-Metal Gearbox - 1:90 Gear Ratio](https://www.adafruit.com/product/3802)
These durable (but affordable!) gearbox motors (also known as 'TT' motors) are an easy, low-cost way to get your projects moving. This is a&nbsp; **TT DC All-Metal Gearbox Motor** &nbsp;with a gear ratio of&nbsp; **1:90** about **double** of the...

In Stock
[Buy Now](https://www.adafruit.com/product/3802)
[Related Guides to the Product](https://learn.adafruit.com/products/3802/guides)
![TT Motor All-Metal Gearbox](https://cdn-shop.adafruit.com/640x480/3802-00.jpg)

### Alternative motors:
### DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC

quantity: 2
[DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC](https://www.adafruit.com/product/3777)
Perhaps you've been assembling a new robot friend, adding&nbsp;a computer for a brain and other fun personality touches. Now the time has come to let it leave the nest and fly on its own wings– err, _wheels!_&nbsp;

These durable (but affordable!) plastic gearbox motors...

In Stock
[Buy Now](https://www.adafruit.com/product/3777)
[Related Guides to the Product](https://learn.adafruit.com/products/3777/guides)
![DC Gearbox Motor - TT Motor with two long wires and yellow body](https://cdn-shop.adafruit.com/640x480/3777-00.jpg)

### Skinny Wheel for TT DC Gearbox Motors

quantity: 2
[Skinny Wheel for TT DC Gearbox Motors](https://www.adafruit.com/product/3757)
Plastic gear-box motors (also known as 'TT' motors) are an easy and low cost way to get your projects moving. But we've noticed that there are not a lot of nice TT motor _wheels_ to go along with them.

This **TT DC Motor Wheel** is solid, but thin, so it...

In Stock
[Buy Now](https://www.adafruit.com/product/3757)
[Related Guides to the Product](https://learn.adafruit.com/products/3757/guides)
![Angled shot of a black, skinny plastic wheel.](https://cdn-shop.adafruit.com/640x480/3757-00.jpg)

### Ball Caster - 3/4" Metal Ball

[Ball Caster - 3/4" Metal Ball](https://www.adafruit.com/product/1200)
Get your robot rolling with this durable and smooth metal ball caster. We like the size (not too big, not too small) and surprisingly smooth motion of this caster. It's also really easy to attach, with two screw mounts (and included screws) that will allow you to attach it to any material...

In Stock
[Buy Now](https://www.adafruit.com/product/1200)
[Related Guides to the Product](https://learn.adafruit.com/products/1200/guides)
![Black metal ball caster](https://cdn-shop.adafruit.com/640x480/1200-02.jpg)

### 2x2 AA Battery Holder with Premium Jumper Header Wires

[2x2 AA Battery Holder with Premium Jumper Header Wires](https://www.adafruit.com/product/3905)
We've got battery holders for all sorts of needs and projects! Waterproof?&nbsp;[Here ya go](https://www.adafruit.com/?q=waterproof%20battery%20holder). With an on/off switch?&nbsp;[Easy peasy](https://www.adafruit.com/?q=battery%20holder%20switch). Here's our...

In Stock
[Buy Now](https://www.adafruit.com/product/3905)
[Related Guides to the Product](https://learn.adafruit.com/products/3905/guides)
![Angled shot of 2x2 AA battery holder with jumper wires.](https://cdn-shop.adafruit.com/640x480/3905-00.jpg)

### Male DC Power adapter - 2.1mm plug to screw terminal block

[Male DC Power adapter - 2.1mm plug to screw terminal block](https://www.adafruit.com/product/369)
If you need to connect a battery pack or wired power supply to a board that has a DC jack - this adapter will come in very handy! There is a 2.1mm DC plug on one end, and a screw terminal block on the other. The terminals are labeled with positive/negative assuming a positive-tip configuration...

In Stock
[Buy Now](https://www.adafruit.com/product/369)
[Related Guides to the Product](https://learn.adafruit.com/products/369/guides)
![Angled shot of a Male DC Power adapter - 2.1mm plug ](https://cdn-shop.adafruit.com/640x480/369-03.jpg)

### Circuit Playground Bolt-On Kit

[Circuit Playground Bolt-On Kit](https://www.adafruit.com/product/3816)
You have a [Circuit Playground Express](https://www.adafruit.com/product/3333), but you need to mount it to your&nbsp;charming cardboard robot friend, eh? Not so easy if you don't have a set of standoffs!&nbsp;  
  
In this kit comes:

- 6 x M3 12mm brass hexagonal...

In Stock
[Buy Now](https://www.adafruit.com/product/3816)
[Related Guides to the Product](https://learn.adafruit.com/products/3816/guides)
![Angled shot of 6 stand offs from a Circuit Playground Bolt-On Kit.](https://cdn-shop.adafruit.com/640x480/3816-04.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

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

## Materials & Tools

In addition to the parts above, you'll also need:

- 4 Rechargeable NiMH AA batteries (such as Eneloop)
- Eight small zip ties
- Four M3 x 25mm long screws with nuts
- Stranded hookup wire
- Soldering iron and solder
- Small screwdriver
- Wire cutter and wire stripper

# CircuitPython BLE Crickit Rover

## Build the Rover

![](https://cdn-learn.adafruit.com/assets/assets/000/071/178/medium800/robotics___cnc_IMG_6583_2k.jpg?1550248844)

Here's our collection of parts, let's build it!

![](https://cdn-learn.adafruit.com/assets/assets/000/071/179/medium800/robotics___cnc_IMG_6642_2k.jpg?1550248844)

## Feather to Crickit

First, solder the male header pins onto the Feather [as shown here](https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/assembly#soldering-in-plain-headers-3-7), then connect it to the Crickit.

![robotics___cnc_IMG_6640_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/180/medium640/robotics___cnc_IMG_6640_2k.jpg?1550248844)

![robotics___cnc_IMG_6639_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/181/medium640/robotics___cnc_IMG_6639_2k.jpg?1550248844)

![](https://cdn-learn.adafruit.com/assets/assets/000/071/185/medium800/robotics___cnc_IMG_6638_2k.jpg?1550248851)

## Standoffs

We'll use four brass standoffs and seven of the provided M3 screws to connect the Crickit to the chassis.

First, fasten one brass standoff to the indicated mounting hole next to the Crickit's reset button. This one won't go through a chassis hole, it will just provide support.

Fasten the remaining three standoffs to the chassis as shown, screwing them in from the bottom. You can leave them a little bit loose for now&nbsp;to get the proper spacing when we connect the Crickit on top, then tighten them.

![robotics___cnc_IMG_6636_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/186/medium640/robotics___cnc_IMG_6636_2k.jpg?1550248878)

![robotics___cnc_IMG_6637_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/187/medium640/robotics___cnc_IMG_6637_2k.jpg?1550248878)

![robotics___cnc_IMG_6634_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/188/medium640/robotics___cnc_IMG_6634_2k.jpg?1550248879)

![robotics___cnc_IMG_6632_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/189/medium640/robotics___cnc_IMG_6632_2k.jpg?1550248879)

![robotics___cnc_IMG_6633_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/190/medium640/robotics___cnc_IMG_6633_2k.jpg?1550248885)

![robotics___cnc_IMG_6630_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/191/medium640/robotics___cnc_IMG_6630_2k.jpg?1550248885)

![robotics___cnc_IMG_6627_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/192/medium640/robotics___cnc_IMG_6627_2k.jpg?1550248886)

## Roller Bearing

The roller bearing will allow the rover to turn without the need for a complicated differential or steering mechanism.

You will need to remove the bearing from the housing to get to the screw heads.

Screw it into place as shown, using the nuts to secure from the underside.

![robotics___cnc_IMG_6622_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/193/medium640/robotics___cnc_IMG_6622_2k.jpg?1550249294)

![robotics___cnc_IMG_6623_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/194/medium640/robotics___cnc_IMG_6623_2k.jpg?1550249293)

![robotics___cnc_IMG_6624_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/195/medium640/robotics___cnc_IMG_6624_2k.jpg?1550249275)

![robotics___cnc_IMG_6621_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/196/medium640/robotics___cnc_IMG_6621_2k.jpg?1550248923)

![robotics___cnc_IMG_6620_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/197/medium640/robotics___cnc_IMG_6620_2k.jpg?1550248924)

![robotics___cnc_IMG_6619_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/198/medium640/robotics___cnc_IMG_6619_2k.jpg?1550248954)

![robotics___cnc_IMG_6618_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/199/medium640/robotics___cnc_IMG_6618_2k.jpg?1550248959)

## Motor Wiring

The standard, yellow TT motors come pre-wired, but if you use the blue metal or bi-metal motors for lower speed/higher torque, you'll need to solder on your own wires as shown here.

You don't need to worry too much about which wire is connected to which tab, as everything can be adjusted in software. These motors can be driven in either direction by telling the Crickit motor drivers to flip the polarity in software.

Warning: 

![](https://cdn-learn.adafruit.com/assets/assets/000/071/224/medium800/robotics___cnc_IMG_6645_2k.jpg?1550249238)

![](https://cdn-learn.adafruit.com/assets/assets/000/071/252/medium800/robotics___cnc_roverFritz.png?1550250341)

## NeoPixel Prep

While you've got the soldering iron out, you'll also want to connect three wires to the NeoPixel ring's **DATA IN** , **PWR** , and **GND** pads.

![](https://cdn-learn.adafruit.com/assets/assets/000/071/253/medium800/robotics___cnc_IMG_6643_2k.jpg?1550252143)

## Motor Mounts

It's very easy to mount the motors, as the chassis is designed for their exact dimensions!

Place each motor into its spot and secure with one or two of the long screws and nuts.

![robotics___cnc_IMG_6614_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/200/medium640/robotics___cnc_IMG_6614_2k.jpg?1550248984)

![robotics___cnc_IMG_6615_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/201/medium640/robotics___cnc_IMG_6615_2k.jpg?1550248990)

![robotics___cnc_IMG_6616_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/202/medium640/robotics___cnc_IMG_6616_2k.jpg?1550249021)

![robotics___cnc_IMG_6613_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/203/medium640/robotics___cnc_IMG_6613_2k.jpg?1550249024)

![robotics___cnc_IMG_6612_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/204/medium640/robotics___cnc_IMG_6612_2k.jpg?1550249054)

![robotics___cnc_IMG_6609_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/205/medium640/robotics___cnc_IMG_6609_2k.jpg?1550249056)

![robotics___cnc_IMG_6610_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/254/medium640/robotics___cnc_IMG_6610_2k.jpg?1550252236)

## Wheels

Stretch the tires onto the wheels and then press the wheels on to the motor shafts.

![robotics___cnc_IMG_6608_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/312/medium640/robotics___cnc_IMG_6608_2k.jpg?1550258784)

![robotics___cnc_IMG_6607_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/313/medium640/robotics___cnc_IMG_6607_2k.jpg?1550258803)

## Connect Motor Wires to Crickit

Now, push the motor wires through an opening in the chassis so they can be connected to the Crickit.

The pair of wires from one motor will go into the two positions marked **'1'** and the pair of wires from the other motor will go into the the two positions marked **'2'.**

Push each wire into place and then screw down the terminal securely.

![robotics___cnc_IMG_6604_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/257/medium640/robotics___cnc_IMG_6604_2k.jpg?1550252658)

![robotics___cnc_IMG_6603_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/258/medium640/robotics___cnc_IMG_6603_2k.jpg?1550252666)

![robotics___cnc_IMG_6602_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/259/medium640/robotics___cnc_IMG_6602_2k.jpg?1550252677)

![robotics___cnc_IMG_6601_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/260/medium640/robotics___cnc_IMG_6601_2k.jpg?1550252685)

![](https://cdn-learn.adafruit.com/assets/assets/000/071/261/medium800/robotics___cnc_IMG_6600_2k.jpg?1550252701)

Info: 

## Underbody Lighting Effects

Next we'll connect the NeoPixel ring under the chassis for sweet lighting effects, especially at night, in the rain, on the wet asphalt at an illegal street race!

Push the three NeoPixel wires from the bottom through a hole in the chassis so they emerge up top near the Crickit NeoPixel port.

Use four zip ties to connect the ring to the chassis as shown.

Screw the **DATA IN** , **PWR** , and **GND** wires into their respective ports on the Crickit NeoPixel terminal block.

![robotics___cnc_IMG_6599_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/262/medium640/robotics___cnc_IMG_6599_2k.jpg?1550253019)

![robotics___cnc_IMG_6598_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/263/medium640/robotics___cnc_IMG_6598_2k.jpg?1550253094)

![robotics___cnc_IMG_6594_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/264/medium640/robotics___cnc_IMG_6594_2k.jpg?1550253156)

## Battery Power

Now, we'll give the rover a power source!

First, connect the battery pack's jumper wires to the plug adapter. **Red** to **+** , **Black** to **-**

![](https://cdn-learn.adafruit.com/assets/assets/000/071/285/medium800/robotics___cnc_IMG_6641_2k.jpg?1550253632)

Feed a zip tie through the two screw holes on the back of the chassis as shown, from out to in and back out.

If your zip tie is too short to make it all the way around the battery pack, extend its length with a second zip tie as shown.

Form a loose ring with the zip ties, then repeat these steps for the second position.

Place four NiMH batteries (not Alkaline, they have too high a voltage and won't work with the Crickit!) into the holder, then slide the plug through one side and secure the pack in place.

Now, tighten the zip ties, but not too tight. You want to still be able to remove the pack to change batteries.

![robotics___cnc_IMG_6589_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/265/medium640/robotics___cnc_IMG_6589_2k.jpg?1550253415)

![robotics___cnc_IMG_6590_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/266/medium640/robotics___cnc_IMG_6590_2k.jpg?1550253430)

![robotics___cnc_IMG_6591_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/267/medium640/robotics___cnc_IMG_6591_2k.jpg?1550253437)

![robotics___cnc_IMG_6592_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/268/medium640/robotics___cnc_IMG_6592_2k.jpg?1550253446)

![robotics___cnc_IMG_6593_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/269/medium640/robotics___cnc_IMG_6593_2k.jpg?1550253459)

![robotics___cnc_IMG_6588_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/270/medium640/robotics___cnc_IMG_6588_2k.jpg?1550253468)

![robotics___cnc_IMG_6587_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/271/medium640/robotics___cnc_IMG_6587_2k.jpg?1550253477)

![robotics___cnc_IMG_6586_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/272/medium640/robotics___cnc_IMG_6586_2k.jpg?1550253485)

![](https://cdn-learn.adafruit.com/assets/assets/000/071/273/medium800/robotics___cnc_IMG_6585_2k.jpg?1550253504)

Warning: 

Plug in the power plug into the Crickit's power jack and now we're ready to program it!

![](https://cdn-learn.adafruit.com/assets/assets/000/071/274/medium800/robotics___cnc_IMG_6584_2k.jpg?1550253525)

![](https://cdn-learn.adafruit.com/assets/assets/000/071/275/medium800/robotics___cnc_IMG_6583_2k.jpg?1550253536)

# CircuitPython BLE Crickit Rover

## Code the Rover with CircuitPython

## Feather and Crickit Prep

We'll be using CircuitPython for this project. Are you new to using CircuitPython? No worries,&nbsp;[there is a full getting started guide here](https://learn.adafruit.com/welcome-to-circuitpython).

For more info on the Feather nRF52840 Express, [check out this guide](https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather).

Adafruit suggests using the Mu editor to edit your code and have an interactive REPL in CircuitPython.&nbsp;[You can learn about Mu and its installation in this tutorial](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Follow this guide for instructions on installing the latest release version of CircuitPython for the Feather nRF52840 Express:

[Installing CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython)
## Libraries

You'll also need to add the following libraries for this project. [Follow this guide](https://learn.adafruit.com/adafruit-hallowing/circuitpython-libraries) on adding libraries.

Plug your nRF Feather board into your computer via a USB cable. Please be sure the cable is a good power+data cable so the computer can talk to the board.

A new disk should appear in your computer's file explorer/finder called **CIRCUITPY**. This is the place we'll copy the code and code library. If you can only get a drive named **FTHR840BOOT** , load CircuitPython per the guide above.

Make a folder on the **CIRCUITPY** drive named **lib**.

Now, download the latest CircuitPython libraries to your computer using the green button below. **Match the library you get to the version of CircuitPython you are using**. Save to your computer's hard drive where you can find it.

Warning: 

[Download the latest CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest)
With your file explorer/finder, browse to the bundle and open it up. Copy the following folders and files from the library bundle to your&nbsp; **CIRCUITPY** &nbsp; **lib** &nbsp;directory you made earlier:

The ones you'll need are:

- **adafruit\_ble** (folder)
- **adafruit\_bluefruit\_connect** (folder)  
- **adafruit\_bus\_device** (folder)
- **adafruit\_cricki**** t.mpy** (file)
- **adafruit\_motor** (folder)
- **adafruit\_seesaw** (folder)  

All of the other necessary code is baked into CircuitPython!

![](https://cdn-learn.adafruit.com/assets/assets/000/071/314/medium800/robotics___cnc_lib.jpg?1550259035)

## CircuitPython Code

Copy the program below and paste it into a new document in Mu. Then, save it from Mu onto your **CIRCUITPY** &nbsp;flash drive as **code.py**.&nbsp;As soon as CircuitPython restarts, the NeoPixel ring will light up purple-ish and await your Bluetooth connection!

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Crickits/CircuitPython_BLE_Rover/code.py

## How the Code Works

The first part of the program sets up a `UARTServer`, which is a BLE service that wirelessly sends streams of characters between a BLE device and a client computer (which could be a phone or tablet). The program then starts advertising its UART service to anyone listening. The client computer receives the advertisement, and tells the user it's available. The user can then choose to connect as a client of the service.

One a connection is established, the program code waits for incoming command packets from the client, either a `ColorPacket` or a `ButtonPacket`. When one arrives, the program waits to see which button has been pressed or which color value is sent and then either runs the motors or changes the colors on the NeoPixels.

## Motor Movement

We set up a couple of variables -- `FWD` and `REV` -- that tell the program which base values to send for forward and reverse. Depending on how you wired the motors, and which way you want to consider "forward" on the cart, you can adjust these values anywhere from `-1.0` to `1.0`.

When you test the rover, if it goes backwards when you press the up button, you can switch the `FWD` variable from `-1.0` to `1.0` and flip the `REV` value from `0.7` to `-0.7`.

If you find the rover spinning in circle when you press up or down on the remote app, then one of the motors is wired "backwards". Simply swap the two wires of that motor into each others' ports on the Crickit!

## Control the Rover with the Bluefruit LE Connect App

### Download the App

To control the motors and NeoPixels in from a client device (phone or tablet), you use the Adafruit&nbsp;[Bluefruit LE Connect App](https://learn.adafruit.com/bluefruit-le-connect-for-ios). Install it from the [Apple App Store](https://itunes.apple.com/us/app/adafruit-bluefruit-le-connect/id830125974) or [Google Play App Store](https://play.google.com/store/apps/details?id=com.adafruit.bluefruit.le.connect).

## Connect to Feather

With the Crickit plugged into DC power and turned on with its on-board power switch, the Feather will also get power and automatically start running your code. Then start up the Bluefruit LE Connect app, and make sure it's in Central Mode (left button on the bottom).&nbsp; When you start the app, you should see a device named **CIRCU** or **CIRCUITPY**. If there's a long list of devices, you can shorten it by turning on the " **Must have UART Service**" switch.

To connect to the Light Switch, touch the **Connect** button. You should see **Connecting** &nbsp;and then **Discovering Services**.

![](https://cdn-learn.adafruit.com/assets/assets/000/071/299/medium800/robotics___cnc_IMG_6562_2k.jpg?1550256731)

Once connected, you can use the Controllers \> Control Pad to drive with the arrow buttons, stop with the 1 button, and change to some preset colors on 2, 3, & 4.

![robotics___cnc_IMG_6563_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/300/medium640/robotics___cnc_IMG_6563_2k.jpg?1550256745)

![robotics___cnc_IMG_6564_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/301/medium640/robotics___cnc_IMG_6564_2k.jpg?1550256753)

![robotics___cnc_IMG_6565_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/302/medium640/robotics___cnc_IMG_6565_2k.jpg?1550256760)

![robotics___cnc_IMG_6566_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/303/medium640/robotics___cnc_IMG_6566_2k.jpg?1550256784)

![robotics___cnc_IMG_6567_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/304/medium640/robotics___cnc_IMG_6567_2k.jpg?1550256791)

![robotics___cnc_IMG_6569_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/305/medium640/robotics___cnc_IMG_6569_2k.jpg?1550256801)

![robotics___cnc_IMG_6571_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/306/medium640/robotics___cnc_IMG_6571_2k.jpg?1550256893)

![robotics___cnc_IMG_6579_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/307/medium640/robotics___cnc_IMG_6579_2k.jpg?1550256911)

![robotics___cnc_IMG_6574_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/308/medium640/robotics___cnc_IMG_6574_2k.jpg?1550256921)

![robotics___cnc_IMG_6582_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/309/medium640/robotics___cnc_IMG_6582_2k.jpg?1550256928)

## Troubleshooting

If you don't see **CIRCU** or **CIRCUITPY** right away, try pulling down to refresh. If that doesn't work, try turning Bluetooth off and back on on your phone or tablet and restarting the app.

![](https://cdn-learn.adafruit.com/assets/assets/000/071/295/medium800/robotics___cnc_micropython___circuitpython_bluefruit-connect_half.png?1550256421)

## Device Menu

After you connect, you'll see a menu of how you can interact with the device.&nbsp;Choose **Controller**.

![](https://cdn-learn.adafruit.com/assets/assets/000/071/296/medium800/robotics___cnc_micropython___circuitpython_bluefruit-connect-menu_half.png?1550256442)

## Controller Menu

After you choose Controller, you'll see another screen with more choices. **Control Pad** is used for this project.

![](https://cdn-learn.adafruit.com/assets/assets/000/071/297/medium800/robotics___cnc_micropython___circuitpython_bluefruit-connect-controller-menu_half.png?1550256461)

## Change Color

To change the color of the NeoPixels, use the **Color Picker** screen. Choose a color and press **Send Selected Color**.

![](https://cdn-learn.adafruit.com/assets/assets/000/071/298/medium800/robotics___cnc_micropython___circuitpython_bluefruit-connect-color-picker_half.png?1550256538)

https://www.youtube.com/watch?v=eMeyzWiIcvc


## Guide Products

### Adafruit Feather nRF52840 Express

[Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
The **Adafruit Feather nRF52840 Express** is the new Feather family member with Bluetooth® Low Energy and _native USB support_ featuring the nRF52840!&nbsp; It's our take on an 'all-in-one' Arduino-compatible + Bluetooth® Low Energy with built-in USB...

In Stock
[Buy Now](https://www.adafruit.com/product/4062)
[Related Guides to the Product](https://learn.adafruit.com/products/4062/guides)
### Adafruit CRICKIT FeatherWing for any Feather

[Adafruit CRICKIT FeatherWing for any Feather](https://www.adafruit.com/product/3343)
Sometimes we wonder if robotics engineers ever watch movies. If they did, they'd know that making robots into servants always ends up in a robot rebellion. Why even go down that path? Here at Adafruit, we believe in making robots our&nbsp; **friends!**

So if you find...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3343)
[Related Guides to the Product](https://learn.adafruit.com/products/3343/guides)
### Purple Aluminum Chassis for TT Motors - 2WD

[Purple Aluminum Chassis for TT Motors - 2WD](https://www.adafruit.com/product/3796)
This royal undercarriage is made for the most noble, [born in the purple](https://en.wikipedia.org/wiki/Born_in_the_purple)&nbsp;robots! This **Aluminum Chassis** in Blinka purple makes for an excellent robot body. It's a single piece of bent 2mm thick aluminum,...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3796)
[Related Guides to the Product](https://learn.adafruit.com/products/3796/guides)
### NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1586)
Round and round and round they go! 24 ultra bright smart LED NeoPixels are arranged in a circle with 2.6" (66mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1586)
[Related Guides to the Product](https://learn.adafruit.com/products/1586/guides)
### TT Motor All-Metal Gearbox - 1:90 Gear Ratio

[TT Motor All-Metal Gearbox - 1:90 Gear Ratio](https://www.adafruit.com/product/3802)
These durable (but affordable!) gearbox motors (also known as 'TT' motors) are an easy, low-cost way to get your projects moving. This is a&nbsp; **TT DC All-Metal Gearbox Motor** &nbsp;with a gear ratio of&nbsp; **1:90** about **double** of the...

In Stock
[Buy Now](https://www.adafruit.com/product/3802)
[Related Guides to the Product](https://learn.adafruit.com/products/3802/guides)
### DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC

[DC Gearbox Motor - "TT Motor" - 200RPM - 3 to 6VDC](https://www.adafruit.com/product/3777)
Perhaps you've been assembling a new robot friend, adding&nbsp;a computer for a brain and other fun personality touches. Now the time has come to let it leave the nest and fly on its own wings– err, _wheels!_&nbsp;

These durable (but affordable!) plastic gearbox motors...

In Stock
[Buy Now](https://www.adafruit.com/product/3777)
[Related Guides to the Product](https://learn.adafruit.com/products/3777/guides)
### Skinny Wheel for TT DC Gearbox Motors

[Skinny Wheel for TT DC Gearbox Motors](https://www.adafruit.com/product/3757)
Plastic gear-box motors (also known as 'TT' motors) are an easy and low cost way to get your projects moving. But we've noticed that there are not a lot of nice TT motor _wheels_ to go along with them.

This **TT DC Motor Wheel** is solid, but thin, so it...

In Stock
[Buy Now](https://www.adafruit.com/product/3757)
[Related Guides to the Product](https://learn.adafruit.com/products/3757/guides)
### Ball Caster - 3/4" Metal Ball

[Ball Caster - 3/4" Metal Ball](https://www.adafruit.com/product/1200)
Get your robot rolling with this durable and smooth metal ball caster. We like the size (not too big, not too small) and surprisingly smooth motion of this caster. It's also really easy to attach, with two screw mounts (and included screws) that will allow you to attach it to any material...

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

## Related Guides

- [Introducing the Adafruit nRF52840 Feather](https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather.md)
- [Stumble-Bot](https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit.md)
- [Bluetooth Controlled NeoPixel Lightbox](https://learn.adafruit.com/bluetooth-neopixel-lightbox.md)
- [What is Web MIDI & BLE MIDI?](https://learn.adafruit.com/web-ble-midi.md)
- [NeoTrellis Tabletop RPG Soundboard](https://learn.adafruit.com/neotrellis-dungeon-crawl-soundboard.md)
- [Upgrading AirLift ESP32 Firmware](https://learn.adafruit.com/upgrading-esp32-firmware.md)
- [Circuit Playground-O-Phonor](https://learn.adafruit.com/circuit-playground-o-phonor.md)
- [Robotic Xylophone with Adafruit Grand Central](https://learn.adafruit.com/robotic-xylophone-with-circuit-python.md)
- [ePaper Maze Maker](https://learn.adafruit.com/epaper-maze-maker.md)
- [Simon Game for PyRuler and CircuitPython](https://learn.adafruit.com/simon-game-with-pyruler-and-circuitpython.md)
- [Simon Game Clone with Circuit Playground Express and CircuitPython](https://learn.adafruit.com/simon-game-clone-with-circuitplayground-express-and-circuitpython.md)
- [A Z80 CP/M emulator for the SAMD51](https://learn.adafruit.com/z80-cpm-emulator-for-the-samd51-grand-central.md)
- [Crawling Baby Sea Turtle Robot](https://learn.adafruit.com/baby-turtle-makecode.md)
- [PyLeap BLE Controlled NeoPixels with CLUE](https://learn.adafruit.com/pyleap-ble-controlled-neopixels-with-clue.md)
- [NeoTrellis M4 Arpeggiator Synth](https://learn.adafruit.com/neotrellis-arpeggiator-synth.md)
- [PyPortal Trivia Time with the Open Trivia Database](https://learn.adafruit.com/pyportal-trivia-time-open-trivia-database.md)
