first commit

This commit is contained in:
tiijay
2025-11-03 15:05:22 +01:00
commit 941c168de8
24 changed files with 728 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
{
"name": "BlinkLed",
"version": "1.0.0",
"description": "A simple LED control library with internal LED helper.",
"authors": [{ "name": "TiiJay14" }],
"frameworks": "arduino"
}

View File

@@ -0,0 +1,16 @@
#ifndef BLINKINTERNLED
#define BLINKINTERNLED
#include <Arduino.h>
#include "BlinkLed.h"
class BlinkInternLed : public BlinkLed
{
private:
/* data */
public:
BlinkInternLed() : BlinkLed(LED_BUILTIN) {}
~BlinkInternLed() {}
};
#endif

View File

@@ -0,0 +1,25 @@
#include "BlinkLed.h"
BlinkLed::BlinkLed(byte pin)
{
BlinkLed();
_pin = pin;
pinMode(_pin, OUTPUT);
}
String BlinkLed::ledStatus()
{
return _ledStatus == HIGH ? "HIGH" : "LOW";
}
void BlinkLed::on()
{
_ledStatus = HIGH;
digitalWrite(_pin, _ledStatus);
}
void BlinkLed::off()
{
_ledStatus = LOW;
digitalWrite(_pin, _ledStatus);
}

View File

@@ -0,0 +1,24 @@
#ifndef BLINKLED
#define BLINKLED
#include <Arduino.h>
class BlinkLed
{
private:
PinStatus _ledStatus;
byte _pin;
/* data */
BlinkLed() { _ledStatus = LOW; }
public:
BlinkLed(byte pin);
~BlinkLed() {}
void on();
void off();
String ledStatus();
};
#endif