> For the complete documentation index, see [llms.txt](https://nxp.gitbook.io/8mmnavq/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nxp.gitbook.io/8mmnavq/navq-developer-guide/communication-protocols/i2c/battery-led-w-teensy-lc.md).

# 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!](/files/-MGtWXKPPIPXaRcHR8SC)

## 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="/pages/-M5PNcEgVvP9yH7brmoF" %}
[ROS1](/8mmnavq/navq-developer-guide/software-support/untitled.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MCI0\_-0lXGo\_PNz8iJX" %}
[Controlling your drone from NavQ using MAVROS](/8mmnavq/navq-developer-guide/software-support/untitled/untitled.md)
{% endcontent-ref %}

### Hardware

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

{% content-ref url="/pages/-MGJOdXW-5kV6S0xxj3M" %}
[I2C](/8mmnavq/navq-developer-guide/communication-protocols/i2c.md)
{% 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="/files/-MGtRwE3dUsA8AH3GA93" %}
Teensy batt\_led code
{% endfile %}

### NavQ code

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

{% file src="/files/-MGtSPDPwEzYf11B9WcT" %}
ROS node
{% endfile %}

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

{% file src="/files/-MGtSSN5jbcr43EEFUu0" %}
"systemd" service file
{% endfile %}

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

{% file src="/files/-MGtSVs3-953CJK3HE6z" %}
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
```
