Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<LiquidCrystal.h>
- LiquidCrystal lcd(13,12,11,10,9,8);
- char c[10];
- int idx=0,i,ct=0;
- void setup()
- {
- pinMode(2, OUTPUT);
- pinMode(3, INPUT);
- pinMode(4, INPUT);
- pinMode(5, INPUT);
- pinMode(6, INPUT);
- pinMode(7, INPUT);
- lcd.begin(16,2);
- for(i=0;i<9;i++){ c[i]=' '; }
- ct=0;
- }
- void loop()
- {
- if(digitalRead(3)==HIGH){
- digitalWrite(2,HIGH);
- c[idx++]='.';
- ct++;
- }
- else if(digitalRead(4)==HIGH){
- digitalWrite(2,HIGH);
- c[idx++]='-';
- ct++;
- }
- else if(digitalRead(5)==HIGH){
- digitalWrite(2,HIGH);
- lcd.print(ct);
- lcd.print(c);
- while(1){}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement