• How to make light that turns on and off every 5 seconds?
    9 replies, posted
hai bananas, lol, it doesn't need to be 5, i just need tutorial, dumb ftw
Well, I guess this could be done with Wire, but if you don't want to learn Wire you could bind it to a numpad button and press that repeatably
I know to wire some hard things, but this shit, I just can't get it to work... We are talking about disco, lol, if I use random chip it turns off and on every second, but I need it to turn on/off every 5 seconds...
Wire - Time - Pulser that or e2.
Wired light, multiplier, constant value (255,5), button, pulser Pulser's 'clk' (or whatever it is) to Button (toggled). Pulser's 'tick time' to constant value (5). Multiplier's A to Pulser Multiplier's B to Constant value (255) Multiplier's C to Button Light's R,G,B to Multiplier Or... [code] @name Timer Light @inputs Button @outputs Light @persist Toggle @trigger none interval(5000) Toggle = !Toggle Light = Toggle*255*Button [/code]
[QUOTE=whosdr;29167035]Wired light, multiplier, constant value (255,5), button, pulser Pulser's 'clk' (or whatever it is) to Button (toggled). Pulser's 'tick time' to constant value (5). Multiplier's A to Pulser Multiplier's B to Constant value (255) Multiplier's C to Button Light's R,G,B to Multiplier Or... [code] @name Timer Light @inputs Button @outputs Light @persist Toggle @trigger none interval(5000) if (Button) {Toggle = !Toggle} Light = Toggle*255*Button [/code][/QUOTE] The if statement is pointless.
Heh yeah, code left over from thinking. I changed to *Button without removing the statement.
[QUOTE=whosdr;29167035]Wired light, multiplier, constant value (255,5), button, pulser Pulser's 'clk' (or whatever it is) to Button (toggled). Pulser's 'tick time' to constant value (5). Multiplier's A to Pulser Multiplier's B to Constant value (255) Multiplier's C to Button Light's R,G,B to Multiplier Or... [code] @name Timer Light @inputs Button @outputs Light @persist Toggle @trigger none interval(5000) Toggle = !Toggle Light = Toggle*255*Button [/code][/QUOTE] This. If you want to integrate it into an expression with an interval of something like 100 do this [code] interval(100) if(first()|duped()){Timer=50} Timer-- if(Timer==0){ Timer=50 Light=!Light } [/code]
[QUOTE=GlockN9ne;29183732] If you want to integrate it into an expression with an interval of something like 100 do this [code] interval(100) if(first()|duped()){Timer=50} Timer-- if(Timer==0){ Timer=50 Light=!Light } [/code][/QUOTE] How is this any different from interval(5000) on my code? You also forgot to persist Time, and put no inputs or outputs on it.
nvm, I used Delay chip
Sorry, you need to Log In to post a reply to this thread.