First init.

This commit is contained in:
2025-10-12 09:13:56 +02:00
commit 1548aeaf9b
458 changed files with 118808 additions and 0 deletions

35
esptest/esptest.ino Normal file
View File

@@ -0,0 +1,35 @@
const int potPin = 10; // Analog pin for potentiometer input
const int pwmPin = 39; // PWM pin for output
const int ledPin = 15; // Built-in LED pin
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
// Set PWM pin and LED pin as outputs
pinMode(pwmPin, OUTPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
// Read the value from the potentiometer
int potValue = analogRead(potPin);
// Map the potentiometer value (0-1023) to PWM range (0-255)
int dutyCycle = map(potValue, 0, 1023, 0, 255);
// Output the duty cycle
analogWrite(pwmPin, dutyCycle);
// Print potentiometer value and corresponding duty cycle
Serial.print("Potentiometer Value: ");
Serial.print(potValue);
Serial.print(" Duty Cycle: ");
Serial.println(dutyCycle);
// Blink the built-in LED
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
delay(500);
}