---
description: '[WIP]'
---

# Battery LED w/ Teensy LC

## Introduction

This "Project Guide" is written to show some of the capabilites of NavQ. In conjunction with a Teensy LC and a strip of WS2812B LEDs, you can add a forward-facing battery indicator light to your drone.

![The battery on my drone is quite low!](https://2703363869-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-CCnxDe4dTvAz3QmDw%2F-MGtTTCEOv2O8m0hsiq2%2F-MGtWXKPPIPXaRcHR8SC%2Fpic.jpg?alt=media\&token=713f710c-87d9-471c-9435-3a722d5d1440)

## Prerequisites

### Software

The software needed to run this project on your NavQ is as follows:

1. ROS Noetic
2. MAVROS

You can install this software using the guides here:

{% content-ref url="../../software-support/untitled" %}
[untitled](../../software-support/untitled)
{% endcontent-ref %}

{% content-ref url="../../software-support/untitled/untitled" %}
[untitled](../../software-support/untitled/untitled)
{% endcontent-ref %}

### Hardware

The hardware needed is the same as the hardware from the I2C guide here:

{% content-ref url="" %}
[]()
{% endcontent-ref %}

## Code

At the moment, we're just going to paste the code here, and a more detailed guide will be written later.

### Teensy code

This code should be uploaded to the Teensy using the Arduino IDE.&#x20;

{% file src="https://2703363869-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-CCnxDe4dTvAz3QmDw%2F-MGtKbjsE86TyNzCfDhR%2F-MGtRwE3dUsA8AH3GA93%2Fbatt_led.zip?alt=media&token=c059885a-122c-4068-ac85-bc97eabe9c15" %}
Teensy batt\_led code
{% endfile %}

### NavQ code

The ROS node should be placed in the home folder ('/home/navq/')

{% file src="https://2703363869-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-CCnxDe4dTvAz3QmDw%2F-MGtKbjsE86TyNzCfDhR%2F-MGtSPDPwEzYf11B9WcT%2Fbatt_led.py?alt=media&token=193cfc5a-12c6-462f-a790-44cd5bf6c395" %}
ROS node
{% endfile %}

The service file should be located in /etc/systemd/system/.

{% file src="https://2703363869-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-CCnxDe4dTvAz3QmDw%2F-MGtKbjsE86TyNzCfDhR%2F-MGtSSN5jbcr43EEFUu0%2Fbatt_led.service?alt=media&token=588ad303-3661-4a99-9d52-1773208548dc" %}
"systemd" service file
{% endfile %}

The Launch script should be located in /usr/local/bin/.

{% file src="https://2703363869-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M-CCnxDe4dTvAz3QmDw%2F-MGtKbjsE86TyNzCfDhR%2F-MGtSVs3-953CJK3HE6z%2Fbatt_led.sh?alt=media&token=83e6431d-eb30-4972-afa1-c0cfb3e31962" %}
Launch script
{% endfile %}

### Making the ROS node run on boot

Once all of the necessary files are placed in their respective directories, you need to make the systemd service run at boot. To do this, run in the terminal:

```
$ sudo systemctl enable batt_led
```
