Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <lcd.h>
- #include <stdio.h>
- void czekaj();
- int main(){
- unsigned char znak = '\0';
- unsigned char memo= '\0';
- unsigned int ciag = 0;
- unsigned int flaga = 0;
- unsigned int ifEnter = 0;
- lcd_init();
- out_instr(0x01);
- czekaj();
- while(1)
- {
- znak = get_kb();
- if(znak=='\0')
- memo=znak;
- if (memo!=znak) {
- czekaj();
- if((znak >='0') && (znak<='9'))
- {
- if(flaga==1){
- out_instr(0x01);
- flaga=0;}
- out_char(znak);
- memo = znak;
- ciag = ciag*10 + ((int)znak -48);
- ifEnter = 0;
- }
- else if(znak == 'e' && ifEnter == 0) {
- flaga=1;
- out_char(ciag);
- memo = znak;
- ciag = 0;
- ifEnter = 1;
- }
- }
- }
- }
- void czekaj() {
- int i=0;
- while(1) {
- i++;
- if(i==30000) break;
- }
- }
Add Comment
Please, Sign In to add comment