Hello,
I'm looking to program Simon says into a PIC chip.
The chip we must use is a 16F84, I would happily program the exact same game into Simon and just sit there for hours writing hundreds and hundreds of lines of code, the frustration is driving me in this direction.
I would like to make it easier by having the program randomly generate the 4 colour pattern on its own and respond to the users input.
BUT
I have no idea how to get the chip to generate a random number from 1-4.
I want 4 ports on PORTA to turn the 4 different coloured LED's on and off.
I want 4 ports on PORTB to accept inputs from the user based on the four LED's
I want 2-3 ports on PORTB to link up to 2 4017's - a bargraph display to display the score. Where the first input would be for the clock, the second for the reset and the third for the enable (if I require it)
So there is 1 port left on PORTA and the interrupt (RB0) on PORTB.
What can I do to get this random generator? just to decide the next coloured LED to light up.
It can be anything, not necessarily a random generator but the closest thing that at least sort of appears random, to the user anyway.
Please, if anyone can help, I'm desperate.
I'm looking to program Simon says into a PIC chip.
The chip we must use is a 16F84, I would happily program the exact same game into Simon and just sit there for hours writing hundreds and hundreds of lines of code, the frustration is driving me in this direction.
I would like to make it easier by having the program randomly generate the 4 colour pattern on its own and respond to the users input.
BUT
I have no idea how to get the chip to generate a random number from 1-4.
I want 4 ports on PORTA to turn the 4 different coloured LED's on and off.
I want 4 ports on PORTB to accept inputs from the user based on the four LED's
I want 2-3 ports on PORTB to link up to 2 4017's - a bargraph display to display the score. Where the first input would be for the clock, the second for the reset and the third for the enable (if I require it)
So there is 1 port left on PORTA and the interrupt (RB0) on PORTB.
What can I do to get this random generator? just to decide the next coloured LED to light up.
It can be anything, not necessarily a random generator but the closest thing that at least sort of appears random, to the user anyway.
Please, if anyone can help, I'm desperate.