ßæÏ:
#include <LiquidCrystal.h>
const int rs=12, en=11, d4=7, d5=6, d6=5, d7=4;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
int buttonPin = 3; // Define button as pin no 3
unsigned int MyCounter = 0; // Define a counter with zero in it
void setup() {
{
// put your setup code here, to run once:
pinMode(buttonPin, INPUT); // Define pin 3 named buttonPin as input
}
}
void loop() {
{
lcd.begin(16,2);
lcd.setCursor(2,0);
lcd.print ("TIME:");
lcd. setCursor(8,0);
lcd.print (M yCounter);
lcd.setCursor(1,1);
lcd.print("speed:");
delay(300);
}
{
// put your main code here, to run repeatedly:
// loop checks the button pin each time,
// and will start count if it is pressed
// loop while the button is not pressed.
while (digitalRead(buttonPin) == LOW) { }
// signal the end of the calibratio
while (true){
delay(1000); // waits for a second
++MyCounter ;
}
}
}
ÇÎí ÇáßÑíã ÌÒÇß Çááå ßá ÎíÑ
ÑÝÚÊ ÇáßæÏ ßÊÈ ÑÞã ÕÝÑ Úáì Çá Óí Ïí æáßä ÚäÏ ÇáÖÛØ Úáì ÇáãÝÊÇÍ áÇ ÊÛííÑ