//https://www.arduino.cc/en/Main/ArduinoBoardProMini //Board : Arduino pro or pro mini //Processor : Atmega168 3.3v 8000Mhz //Press reset just before upload #define PIN_LIGHT 3 #define DELAY_SHORT 500 #define DELAY_LONG 1500 #define LIGHT_DECREASE 10 unsigned long _nextPulse = 0; bool _delayShort = false; byte _light = 0; void setup() { pinMode(PIN_LIGHT, OUTPUT); } void loop() { if(millis() >= _nextPulse) { _light = 255; //Full light _delayShort = !_delayShort; //Toggleling short / long delay : |\_|\_____|\_|\_____|\_|\_____ _nextPulse += (unsigned long)(_delayShort ? DELAY_SHORT : DELAY_LONG); } else if(_light > LIGHT_DECREASE) _light -= LIGHT_DECREASE; //Progressive decreasing |\<- analogWrite(PIN_LIGHT, _light); delay(10); }