Arduino delay random1/21/2024 loop_tail() the name of the loop you want to run when the case number is randomly picked.case 0: the number assigned to the loop which will be called upon with the switch command, if you add another loop to be controlled it would be case 1, followed by case 2 and so on.switch (randNum) switches between the cases listed.byte randNum = random(3) creates a max range of random numbers that can be assigned.void loop() this is where you'll list all the servo loops you created to be triggered at random.tail.attach(9) attaches the servo on pin 9, each servo would get a line of code attaching it to its own pin.void setup() is run one to setup your board and pins.delay(t3) pauses movement for a random amount of time according to the range defined in int 3.tail.write(0) resets the servo to its neutral starting position.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |