Total Pageviews

Showing posts with label blink. Show all posts
Showing posts with label blink. Show all posts

Monday, April 20, 2020

Flashing led without delay

   I found another solution to made flashing led without delay than example from arduino IDE
   My solution is to use also millis() function but in other style. Millis() function count time from power up the Arduino (microcontroller)
   I use another variable, to made time from power up in seconds.After that I use rest function (%), for odd number led is on, for even number led is off. For example: 7%2=1 => led on, 8%2=0 => led off.
  You can see a simple mobvie with this style for control a led:
   I wrote 2 simple sketches: blink_wo_delay.ino and blink_wo_delay2.ino with same effects but little changes as commands.