mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 11:33:17 +02:00
Todo subido
This commit is contained in:
parent
f0db3a8aeb
commit
27026caf57
87 changed files with 83292 additions and 17 deletions
40
Pantalla/include/led_strip.hpp
Normal file
40
Pantalla/include/led_strip.hpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef LED_STRIP_HPP
|
||||
#define LED_STRIP_HPP
|
||||
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#include "common/crowpanel_pins.h"
|
||||
|
||||
#define PIN_WS2812B 6
|
||||
//#define PIN_WS2812B GPIO_AVAILABLE_1
|
||||
#define NUM_PIXELS 18
|
||||
#define T_PARPADEO 50
|
||||
|
||||
#define STOP_CAR_WARNING 1
|
||||
|
||||
#define RPM_MIN 8000
|
||||
#define RPM_MAX 12500
|
||||
|
||||
class LedStrip{
|
||||
public:
|
||||
LedStrip(): _ws2812b(NUM_PIXELS, PIN_WS2812B, NEO_GRB + NEO_KHZ800), _warning(0), _brightness(255) {}
|
||||
|
||||
void begin(){
|
||||
_ws2812b.begin();
|
||||
}
|
||||
|
||||
void display_rpm(int rpm);
|
||||
void display_startup();
|
||||
void launch_control(bool estado);
|
||||
|
||||
private:
|
||||
Adafruit_NeoPixel _ws2812b;
|
||||
SemaphoreHandle_t _mutex;
|
||||
int _rpm;
|
||||
int _warning;
|
||||
int _brightness;
|
||||
bool launch=false;
|
||||
uint32_t last_parpadeo=0;
|
||||
bool estado_parpadeo=false;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue