feat: 全量同步 254 个常用的 Arduino 扩展库文件
This commit is contained in:
42
arduino-libs/arduino-cli/libraries/LEDbar/src/LEDbar.h
Normal file
42
arduino-libs/arduino-cli/libraries/LEDbar/src/LEDbar.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef LEDbar_h
|
||||
#define LEDbar_h
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
class LEDbar
|
||||
{
|
||||
|
||||
public:
|
||||
// Constructor without dim pin
|
||||
LEDbar(uint8_t clk, uint8_t data);
|
||||
|
||||
// Pass the number of LEDs
|
||||
void begin(uint8_t numberOfLEDs);
|
||||
|
||||
// Clear the LED bar
|
||||
void clear();
|
||||
|
||||
// Turn on all LEDs
|
||||
void all();
|
||||
|
||||
// Set n dots from position x
|
||||
void setDots(uint8_t position, uint8_t dots);
|
||||
|
||||
// Turn on n leds from start position. Use negative numbers to start from the other end
|
||||
void setLevel(int8_t level);
|
||||
|
||||
// Set a repeating pattern, 8 bit standard
|
||||
void setPattern(uint64_t pattern, uint8_t length = 8);
|
||||
|
||||
|
||||
private:
|
||||
// Latch bit
|
||||
void strobe(bool dataIn);
|
||||
|
||||
/* Provate variables */
|
||||
uint8_t _clk;
|
||||
uint8_t _data;
|
||||
uint8_t _numberOfLEDs;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user