Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <REGX52.H>
- void main(){
- unsigned char wiersz[] = {0xF7, 0xFB, 0xFD, 0xFE};
- unsigned char index = 0;
- unsigned char liczba = 0x05;
- P2 = 0;
- while (1){
- P1 = wiersz[index++];
- if (!P1_4){
- if (index != 4){
- liczba *= 0x10;
- liczba += (index - 1) * 3 + 1;
- }
- while (!P1_4);
- }
- else if (!P1_5){
- liczba *= 0x10;
- if (index != 4)liczba += (index - 1) * 3 + 2;
- while (!P1_5);
- }
- else if (!P1_6)
- {
- if (index == 4){
- P2 = liczba;
- liczba = 0;
- }else{
- liczba *= 0x10;
- liczba += (index - 1) * 3 + 3;
- }
- while (!P1_6);
- }
- if (index == 4)index = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement