Difference between revisions of "Light blinking2.nxc"
From RoboWiki
m |
|||
Line 1: | Line 1: | ||
− | + | [[Krúžok Robotiky]] | |
/* | /* |
Latest revision as of 10:28, 26 March 2008
/* This program demonstrates using generator of random numbers light bulb is connected to the port A */ int delay; int i; task main() { while(1) { Off(OUT_ABC); i=random(12); if (i%2==0) OnFwd(OUT_A,50); if(i%3) OnFwd(OUT_B,50); if(i%4) OnFwd(OUT_C,50); delay=random(250)+50; Wait(delay); } }