Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <REGX52.H>
- #define TRUE 1
- void main(void){
- char tabID = 0;
- char code tab[] = {0xFE, 0xFD, 0xFB, 0xF7};
- char code values[4][3] = {{0x01,0x02,0x03},{0x04,0x05,0x06},{0x07,0x08,0x09},{0x0E,0,0x0F}};
- while(TRUE)
- {
- tabID = tabID%4;
- P1 = tab[tabID];
- if(P1 != tab[tabID])
- {
- if(P1_4==0) {
- P2 = values[tabID][0];
- }
- else if(P1_5==0){
- P2 = values[tabID][1];
- }
- else {
- P2 = values[tabID][2];
- }
- }
- tabID++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement