Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino source code for KC868-ASR]-04 BEEP
#1
Code:
#define BEEP 18
#define S2 0

void setup() {
  Serial.begin(115200);
  pinMode(BEEP,OUTPUT);
  pinMode(S2,INPUT);

  digitalWrite(BEEP, HIGH);
  delay(200);
  digitalWrite(BEEP,LOW);
  delay(200);
   
}

void loop() {

if(digitalRead(S2)==LOW){
  delay(20);
  if(digitalRead(S2)==LOW)
  {
    digitalWrite(BEEP, HIGH);
    delay(100);
    digitalWrite(BEEP, LOW);
    delay(10); 
  } 
}else digitalWrite(BEEP, LOW);
}


Attached Files
.zip   KC868-ASR_BEEP.zip (Size: 102.86 KB / Downloads: 165)
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)