lorawan/sodaq_one/ns_buzzer.ino

21 lines
281 B
Arduino
Raw Normal View History

2017-02-19 10:06:05 +00:00
#include <Arduino.h>
void setupBuzzer(int pin)
{
pinMode(pin, OUTPUT);
}
void buzzerOn(int pin) {
digitalWrite(pin, HIGH);
}
void buzzerOff(int pin) {
digitalWrite(pin, LOW);
}
void buzz(int pin, int ms) {
buzzerOn(pin);
delay(ms);
buzzerOff(pin);
}