alvin 0 Posted October 29, 2019 Share Posted October 29, 2019 Yo, there Im using a tm4c1294nctd, Im wondering how to modify the existing blink example to make the internal led (D2/PF4) blinks randomly instead of a fixed time. Im trying to modify the digitalWrite(LED, HIGH); digitalWrite(LED, HIGH); with someting like digitalWrite(LED[j], HIGH); j = (j+1) % 5; But I realized this is gonna run over a given number of leds instead of time. I humbly request ideas. Thanks in advance!!! Quote Link to post Share on other sites
Rei Vilo 695 Posted October 29, 2019 Share Posted October 29, 2019 Try Random Numbers random() randomSeed() Quote Link to post Share on other sites
enl 227 Posted October 29, 2019 Share Posted October 29, 2019 Rei Vilo hit the main point I will ask WHICH blink example you are referring to. There are a number of them. Background: the basic structure is that you turn on the LED, have a delay, turn off the LED, and another delay. What you did include your message does not show the delay... it is what turn on hte LED. There is a delay somewhere, and that is where you want the random value. You may want to restrict the random value to a certain range to keep the random blinking reasonable in appearance. Quote Link to post Share on other sites
energia 485 Posted November 10, 2019 Share Posted November 10, 2019 https://forum.arduino.cc/index.php?topic=5496.0 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.