The project I am currently doing asks me the following:
write a program for a PIC16F84A that converts your a number (10 ASCII characters), one character at a time, to the excess-three code. Each converted character is to be displayed on 4 LEDs connected to Port B (B0 to B3) of the microcontroller. Further, each converted character will be ON for 4 second and OFF for 1 second. Once all characters have been displayed the program will continue to run with all the LEDs flashing (ON for 1 second and OFF for 1 second then repeat this infinitely).
So far I don't have much,
Firstly I am unsure how to call a particular digit from the number eg "0" from "0648321975"
I under stand that I'll subtract 48(decimal) from the number (ASCII "0"="48" decimal - 48 decimal), and then add (3) to get the excess three value (3) then Plug this into Port B(B0 to B3) followed by a delay of a second, then turn off/ initialise Port B again.
Using a counter to count the amount of numbers( if under 10 processed got to start again) ( if more than 10 got to the flashing sequence)
Any help will be greatly appreciated.
Cheers
write a program for a PIC16F84A that converts your a number (10 ASCII characters), one character at a time, to the excess-three code. Each converted character is to be displayed on 4 LEDs connected to Port B (B0 to B3) of the microcontroller. Further, each converted character will be ON for 4 second and OFF for 1 second. Once all characters have been displayed the program will continue to run with all the LEDs flashing (ON for 1 second and OFF for 1 second then repeat this infinitely).
So far I don't have much,
Firstly I am unsure how to call a particular digit from the number eg "0" from "0648321975"
I under stand that I'll subtract 48(decimal) from the number (ASCII "0"="48" decimal - 48 decimal), and then add (3) to get the excess three value (3) then Plug this into Port B(B0 to B3) followed by a delay of a second, then turn off/ initialise Port B again.
Using a counter to count the amount of numbers( if under 10 processed got to start again) ( if more than 10 got to the flashing sequence)
Any help will be greatly appreciated.
Cheers