Rotating beacon light on Arduino
FunduinoPublished on
Den Blinkmodus einer Modell-Warnleuchte per Arduino wechseln
The beacon light
Change the blink mode
Change the beacon's flashing mode
#include <Servo.h>
int pos=0; // Variable for the PWM signal
Servo alarm;
void setup()
{
alarm.attach(9); // The warning light is connected to pin 9 via the signal wire
}
void loop()
{
for (pos = 54; pos <= 110; pos += 1) // This is where a loop begins that raises the PWM signal from 30% to 60%. Since the Servo library is used for the PWM signal, the percentage is represented analogously by the rotation angles between 54 and 110.
{
alarm.write(pos); // Output the PWM signal to the module
delay(10); // The signal remains active for 10 ms
}
delay (1000);
}Rate the instructions