soothing variation on flash pin 13

Just bought a Arduino nano and am waiting for an LCD etc which are on order. Couldn’t wait so did the flashing on board led sketch to get it to do something. Got it going after some com port issues. Had a ratch around the net and found a rgb mood light sketch and thought I could use it on the onboard LED and that it would look nice (it does :slight_smile: ) and if I could actually write something that worked (it did…eventually). Found out PWM doesnt work on pin 13 directly so used delays instead again sourced from web (thx to all). This sketch uses a little maths, delay functions and a for loop. Its best viewed diffused.

Am interested in matching a LED lamp to a micro wind turbine using a nano to pwm the lamp depending on power available (wind speed)- should work using analogue in and a step down regulator to fix led supply… see soon enough.

led_bright_dim_sinusoidal.ino (965 Bytes)