feat: Initialized Repository

This commit is contained in:
Xeovalyte 2023-10-04 13:47:55 +02:00
commit cb2eb9dee3
11 changed files with 108 additions and 0 deletions

42
Arduino/Blink/Blink.ino Executable file
View File

@ -0,0 +1,42 @@
const int ledPin = 4; // Define the LED pin
const int minOnTime = 100; // Minimum time LED is ON in milliseconds
const int maxOnTime = 3000; // Maximum time LED is ON in milliseconds
const int minOffTime = 50; // Minimum time LED is OFF in milliseconds
const int maxOffTime = 200; // Maximum time LED is OFF in milliseconds
unsigned long previousMillis = 0;
int ledState = LOW;
unsigned long onTime = 0;
unsigned long offTime = 0;
void setup() {
pinMode(ledPin, OUTPUT);
generateRandomTimes();
}
void loop() {
unsigned long currentMillis = millis();
if (ledState == LOW) {
if (currentMillis - previousMillis >= offTime) {
// Turn the LED on
ledState = HIGH;
previousMillis = currentMillis;
generateRandomTimes();
}
} else {
if (currentMillis - previousMillis >= onTime) {
// Turn the LED off
ledState = LOW;
previousMillis = currentMillis;
generateRandomTimes();
}
}
digitalWrite(ledPin, ledState);
}
void generateRandomTimes() {
onTime = random(minOnTime, maxOnTime + 1); // Generate a random ON time
offTime = random(minOffTime, maxOffTime + 1); // Generate a random OFF time
}

1
Arduino/Blink/Blink.txt Executable file
View File

@ -0,0 +1 @@
Turn an LED on and off.

View File

@ -0,0 +1,57 @@
#include <Adafruit_NeoPixel.h>
const int redPin = 4;
const int greenPin = 5;
const int bluePin = 13;
const int whitePin = 14;
#define PIN_WS2812B 27
#define NUM_PIXELS 182
Adafruit_NeoPixel ws2812b(NUM_PIXELS, PIN_WS2812B, NEO_GRB + NEO_KHZ800);
void setup() {
ws2812b.begin();
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(whitePin, OUTPUT);
analogWrite(redPin, 0);
analogWrite(greenPin, 0);
analogWrite(bluePin, 0);
analogWrite(whitePin, 0);
}
void loop() {
ws2812b.clear();
for (int pixel = 0; pixel < NUM_PIXELS; pixel++) { // for each pixel
ws2812b.setPixelColor(pixel, ws2812b.Color(125, 249, 255)); // it only takes effect if pixels.show() is called
ws2812b.show(); // update to the WS2812B Led Strip
delay(25); // 500ms pause between each pixel
}
analogWrite(redPin, 0);
analogWrite(greenPin, 0);
analogWrite(bluePin, 0);
analogWrite(whitePin, 0);
analogWrite(redPin, 255);
delay(1000);
analogWrite(redPin, 0);
analogWrite(greenPin, 255);
delay(1000);
analogWrite(greenPin, 0);
analogWrite(bluePin, 255);
delay(1000);
analogWrite(bluePin, 0);
analogWrite(whitePin, 255);
delay(1000);
analogWrite(redPin, 125);
analogWrite(greenPin, 249);
analogWrite(bluePin, 255);
delay(2000);
}

View File

@ -0,0 +1,6 @@
void setup() {
}
void loop() {
}

View File

@ -0,0 +1,2 @@
default_port: /dev/ttyUSB0
default_fqbn: esp32:esp32:nodemcu-32s

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Audio/power-charge-6798.mp3 Normal file

Binary file not shown.

Binary file not shown.