generated from TDD-Templates/cmake_cpputest_template
Compare commits
2 commits
7386e12fb8
...
5ecbbceeb9
Author | SHA1 | Date | |
---|---|---|---|
5ecbbceeb9 | |||
bf87fc9cb4 |
2 changed files with 32 additions and 3 deletions
|
@ -11,6 +11,11 @@
|
||||||
- [BN-220 GPS ](https://www.amazon.com/Navigation-Raspberry-Betaflight-Geekstory-Shipping/dp/B07PRDY6DS?th=1)
|
- [BN-220 GPS ](https://www.amazon.com/Navigation-Raspberry-Betaflight-Geekstory-Shipping/dp/B07PRDY6DS?th=1)
|
||||||
- [LSM303AGR Accelerometer + Compass](https://learn.adafruit.com/lsm303-accelerometer-slash-compass-breakout/overview)
|
- [LSM303AGR Accelerometer + Compass](https://learn.adafruit.com/lsm303-accelerometer-slash-compass-breakout/overview)
|
||||||
|
|
||||||
|
**NOTE:**
|
||||||
|
|
||||||
|
The logic level and voltage supply for the LCD display need to be the same.
|
||||||
|
It's listed as needing to be 3.3v in the documentation.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
The project can be configured to use a variety of hardware or differnt
|
The project can be configured to use a variety of hardware or differnt
|
||||||
|
@ -91,6 +96,7 @@ tree -L 1
|
||||||
|
|
||||||
6 directories, 7 files
|
6 directories, 7 files
|
||||||
```
|
```
|
||||||
|
|
||||||
## Project Dependencies
|
## Project Dependencies
|
||||||
|
|
||||||
- RadioHead RFM9x Library
|
- RadioHead RFM9x Library
|
||||||
|
|
|
@ -266,12 +266,23 @@ void updateLEDs(int heading) {
|
||||||
|
|
||||||
// Updates the distance part of the display
|
// Updates the distance part of the display
|
||||||
void TFT_UpdateDistance(uint16_t meters) {
|
void TFT_UpdateDistance(uint16_t meters) {
|
||||||
|
tft.setTextWrap(false);
|
||||||
|
tft.setCursor(0, 0);
|
||||||
|
tft.setTextColor(ST77XX_WHITE);
|
||||||
|
tft.setTextSize(2);
|
||||||
|
tft.println(meters);
|
||||||
|
tft.println(" Meters");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates the direction part of the display
|
// Updates the direction part of the display
|
||||||
void TFT_UpdateDirection() {
|
void TFT_UpdateDirection(uint16_t degrees) {
|
||||||
|
tft.setTextWrap(false);
|
||||||
|
tft.setCursor(0, 40);
|
||||||
|
tft.setTextColor(ST77XX_WHITE);
|
||||||
|
tft.setTextSize(2);
|
||||||
|
tft.println(meters);
|
||||||
|
tft.println(" Degrees");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates the batter/voltage state.
|
// Updates the batter/voltage state.
|
||||||
|
@ -280,12 +291,23 @@ uint8_t TFT_UpdateBatteryState(uint8_t percentage) {
|
||||||
return Err;
|
return Err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tft.setTextWrap(false);
|
||||||
|
tft.setCursor(0, 80);
|
||||||
|
tft.setTextColor(ST77XX_WHITE);
|
||||||
|
tft.setTextSize(2);
|
||||||
|
tft.println(percentage);
|
||||||
|
tft.println("% Batt");
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Displays the specifications of the node.
|
// Displays the specifications of the node.
|
||||||
void TFT_DisplaySpecs(void) {
|
void TFT_DisplaySpecs(void) {
|
||||||
|
tft.fillScreen(ST77XX_BLACK); // Set the screen background to black
|
||||||
|
|
||||||
|
TFT_UpdateDistance(0);
|
||||||
|
TFT_UpdateDirection(0);
|
||||||
|
TFT_UpdateBatteryState(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -299,6 +321,7 @@ uint8_t TFT_Init(void) {
|
||||||
// Display Setup
|
// Display Setup
|
||||||
tft.init(TFT_X, TFT_Y); // Initialize the display with a resolution of 240x280 pixels
|
tft.init(TFT_X, TFT_Y); // Initialize the display with a resolution of 240x280 pixels
|
||||||
tft.fillScreen(ST77XX_BLACK); // Set the screen background to black
|
tft.fillScreen(ST77XX_BLACK); // Set the screen background to black
|
||||||
|
tft.setRotation(0); // Set's the rotation of the screen.
|
||||||
|
|
||||||
TFT_UpdateDistance(0);
|
TFT_UpdateDistance(0);
|
||||||
TFT_UpdateDirection(0);
|
TFT_UpdateDirection(0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue