We first had to come up with a program that would count how many times we pressed the switch. Here is the program that we came up with.
Then we came up a program that would make the light flash every fifth time we pressed the switch. In order to achieve this, we reset the count back to zero after the fifth count so that the program would make the light flash at every multiple of five. Here is the program that we came up with:
Then we came up a program that would make the light flash every fifth time we pressed the switch. In order to achieve this, we reset the count back to zero after the fifth count so that the program would make the light flash at every multiple of five. Here is the program that we came up with:
No comments:
Post a Comment