Jump to content

sheebuya

EstablishedMember
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sheebuya

  • Rank
    Newbrie
  1. char run; char x; //Endless loop while( 1 ) } { if(porta.0==0x01) // define input button { x=run++; // pass count value to x switch(x) // select which case will be done { { case(0): portb=0x80;//for number 0; portd=0x0f; delay_ms(2); portb=0x40; portd=0x6f; delay_ms(2); portb=0x20; portd=0x6f; delay_ms(2); portb=0x10; portd=0x6f; delay_ms(2); portb=0x08; portd=0x6f; delay_ms(2); portb=0x04; portd=0x6f; delay_ms(2); portb=0x02; portd=0x0f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(1): portb=0x80;//for number 1; portd=0x7f; delay_ms(2); portb=0x40; portd=0x7f; delay_ms(2); portb=0x20; portd=0x7f; delay_ms(2); portb=0x10; portd=0x7f; delay_ms(2); portb=0x08; portd=0x7f; delay_ms(2); portb=0x04; portd=0x7f; delay_ms(2); portb=0x02; portd=0x7f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(2): portb=0x80;//for number 2; portd=0x0f; delay_ms(2); portb=0x40; portd=0x7f; delay_ms(2); portb=0x20; portd=0x7f; delay_ms(2); portb=0x10; portd=0x0f; delay_ms(2); portb=0x08; portd=0xef; delay_ms(2); portb=0x04; portd=0xef; delay_ms(2); portb=0x02; portd=0x0f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(3): portb=0x80;//for number 3; portd=0x0f; delay_ms(2); portb=0x40; portd=0x7f; delay_ms(2); portb=0x20; portd=0x7f; delay_ms(2); portb=0x10; portd=0x0f; delay_ms(2); portb=0x08; portd=0x7f; delay_ms(2); portb=0x04; portd=0x7f; delay_ms(2); portb=0x02; portd=0x0f; delay_ms(2); portb=0x01; portd=0xff; delay_ms(2); } { case(4): portb=0x80;//for number 4; portd=0x6f; delay_ms(2); portb=0x40; portd=0x6f; delay_ms(2); portb=0x20; portd=0x6f; delay_ms(2); portb=0x10; portd=0x0f; delay_ms(2); portb=0x08; portd=0x7f; delay_ms(2); portb=0x04; portd=0x7f; delay_ms(2); portb=0x02; portd=0x7f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(5): portb=0x80;//for number 5; portd=0x0f; delay_ms(2); portb=0x40; portd=0xef; delay_ms(2); portb=0x20; portd=0xef; delay_ms(2); portb=0x10; portd=0x0f; delay_ms(2); portb=0x08; portd=0x7f; delay_ms(2); portb=0x04; portd=0x7f; delay_ms(2); portb=0x02; portd=0x0f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(6): portb=0x80;//for number 6; portd=0x0f; delay_ms(2); portb=0x40; portd=0xef; delay_ms(2); portb=0x20; portd=0xef; delay_ms(2); portb=0x10; portd=0x0f; delay_ms(2); portb=0x08; portd=0x6f; delay_ms(2); portb=0x04; portd=0x6f; delay_ms(2); portb=0x02; portd=0x0f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(7): portb=0x80;//for number 7; portd=0x0f; delay_ms(2); portb=0x40; portd=0x7f; delay_ms(2); portb=0x20; portd=0x7f; delay_ms(2); portb=0x10; portd=0x7f; delay_ms(2); portb=0x08; portd=0x7f; delay_ms(2); portb=0x04; portd=0x7f; delay_ms(2); portb=0x02; portd=0x7f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(8): portb=0x80;//for number 8; portd=0x0f; delay_ms(2); portb=0x40; portd=0x6f; delay_ms(2); portb=0x20; portd=0x6f; delay_ms(2); portb=0x10; portd=0x0f; delay_ms(2); portb=0x08; portd=0x6f; delay_ms(2); portb=0x04; portd=0x6f; delay_ms(2); portb=0x02; portd=0x0f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(9): portb=0x80;//for number 9; portd=0x0f; delay_ms(2); portb=0x40; portd=0x6f; delay_ms(2); portb=0x20; portd=0x6f; delay_ms(2); portb=0x10; portd=0x0f; delay_ms(2); portb=0x08; portd=0x7f; delay_ms(2); portb=0x04; portd=0x7f; delay_ms(2); portb=0x02; portd=0x0f; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(10): portb=0x80;//for number 10; portd=0x0b; delay_ms(2); portb=0x40; portd=0x6b; delay_ms(2); portb=0x20; portd=0x6b; delay_ms(2); portb=0x10; portd=0x6b; delay_ms(2); portb=0x08; portd=0x6b; delay_ms(2); portb=0x04; portd=0x6b; delay_ms(2); portb=0x02; portd=0x0b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(11): portb=0x80;//for number 11; portd=0x77; delay_ms(2); portb=0x40; portd=0x77; delay_ms(2); portb=0x20; portd=0x77; delay_ms(2); portb=0x10; portd=0x77; delay_ms(2); portb=0x08; portd=0x77; delay_ms(2); portb=0x04; portd=0x77; delay_ms(2); portb=0x02; portd=0x77; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(12): portb=0x80;//for number 12; portd=0x0b; delay_ms(2); portb=0x40; portd=0x7b; delay_ms(2); portb=0x20; portd=0x7b; delay_ms(2); portb=0x10; portd=0x0b; delay_ms(2); portb=0x08; portd=0xeb; delay_ms(2); portb=0x04; portd=0xeb; delay_ms(2); portb=0x02; portd=0x0b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(13): portb=0x80;//for number 13; portd=0x0b; delay_ms(2); portb=0x40; portd=0x7b; delay_ms(2); portb=0x20; portd=0x7b; delay_ms(2); portb=0x10; portd=0x0b; delay_ms(2); portb=0x08; portd=0x7b; delay_ms(2); portb=0x04; portd=0x7b; delay_ms(2); portb=0x02; portd=0x0b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(14): portb=0x80;//for number 14; portd=0x6b; delay_ms(2); portb=0x40; portd=0x6b; delay_ms(2); portb=0x20; portd=0x6b; delay_ms(2); portb=0x10; portd=0x0b; delay_ms(2); portb=0x08; portd=0x7b; delay_ms(2); portb=0x04; portd=0x7b; delay_ms(2); portb=0x02; portd=0x7b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(15): portb=0x80;//for number 15; portd=0x0b; delay_ms(2); portb=0x40; portd=0xeb; delay_ms(2); portb=0x20; portd=0xeb; delay_ms(2); portb=0x10; portd=0x0b; delay_ms(2); portb=0x08; portd=0x7b; delay_ms(2); portb=0x04; portd=0x7b; delay_ms(2); portb=0x02; portd=0x0b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(16): portb=0x80;//for number 16; portd=0x0b; delay_ms(2); portb=0x40; portd=0xeb; delay_ms(2); portb=0x20; portd=0xeb; delay_ms(2); portb=0x10; portd=0x0b; delay_ms(2); portb=0x08; portd=0x6b; delay_ms(2); portb=0x04; portd=0x6b; delay_ms(2); portb=0x02; portd=0x0b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(17): portb=0x80;//for number 17; portd=0x0b; delay_ms(2); portb=0x40; portd=0x7b; delay_ms(2); portb=0x20; portd=0x7b; delay_ms(2); portb=0x10; portd=0x7b; delay_ms(2); portb=0x08; portd=0x7b; delay_ms(2); portb=0x04; portd=0x7b; delay_ms(2); portb=0x02; portd=0x7b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(18): portb=0x80;//for number 18; portd=0x0b; delay_ms(2); portb=0x40; portd=0x6b; delay_ms(2); portb=0x20; portd=0x6b; delay_ms(2); portb=0x10; portd=0x0b; delay_ms(2); portb=0x08; portd=0x6b; delay_ms(2); portb=0x04; portd=0x6b; delay_ms(2); portb=0x02; portd=0x0b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(19): portb=0x80;//for number 19; portd=0x0b; delay_ms(2); portb=0x40; portd=0x6b; delay_ms(2); portb=0x20; portd=0x6b; delay_ms(2); portb=0x10; portd=0x0b; delay_ms(2); portb=0x08; portd=0x7b; delay_ms(2); portb=0x04; portd=0x7b; delay_ms(2); portb=0x02; portd=0x0b; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(20): portb=0x80;//for number 20; portd=0x00; delay_ms(2); portb=0x40; portd=0x67; delay_ms(2); portb=0x20; portd=0x67; delay_ms(2); portb=0x10; portd=0x60; delay_ms(2); portb=0x08; portd=0x6e; delay_ms(2); portb=0x04; portd=0x6e; delay_ms(2); portb=0x02; portd=0x00; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } { case(21): portb=0x80;//for number 21; portd=0x70; delay_ms(2); portb=0x40; portd=0x77; delay_ms(2); portb=0x20; portd=0x77; delay_ms(2); portb=0x10; portd=0x70; delay_ms(2); portb=0x08; portd=0x7e; delay_ms(2); portb=0x04; portd=0x7e; delay_ms(2); portb=0x02; portd=0x70; delay_ms(2); portb=0x00; portd=0xff; delay_ms(2); break; } } } } this is my program for the display,unfortunately 'missing semicolon' error occured..any suggestion??correction??anything??anyone??
  2. what is rtfm??i'm kinda new with this programming thing
  3. can you please give example on how the program is done??how we define a switch as an input for the counter??
  4. can you help me with the programming??what commad do u use??any examples??
  5. have anyone done programming as stated here??-16F877 8x8 dot matrix programming to display number(range from 0-20 would be enough),counter type..a switch acts as an input
×
×
  • Create New...