ec11.cpp
Arduino/CCIT4080_CL05_PKPD_Group2/src/Test_components/button_test/ec11.cpp
#include <Arduino.h>
const int VIBRATOR_PIN = 21;
// Mode 1: Short Notification (a quick "bip")
void vibrateNotificationShort() {
digitalWrite(VIBRATOR_PIN, HIGH);
delay(80);
digitalWrite(VIBRATOR_PIN, LOW);
}
// Mode 2: Standard Notification (Double pulse)
void vibrateNotification() {
digitalWrite(VIBRATOR_PIN, HIGH);
delay(150);
digitalWrite(VIBRATOR_PIN, LOW);
delay(100);
digitalWrite(VIBRATOR_PIN, HIGH);
delay(150);
digitalWrite(VIBRATOR_PIN, LOW);
}
// Mode 3: Phone Call (Long pulsing pattern)
void vibratePhoneCall() {
for(int i = 0; i < 5; i++) {
digitalWrite(VIBRATOR_PIN, HIGH);
delay(1000); // 1 second buzz
digitalWrite(VIBRATOR_PIN, LOW);
delay(500); // 0.5 second pause
}
}
void setup() {
pinMode(VIBRATOR_PIN, OUTPUT);
Serial.begin(115200);
}
void loop() {
Serial.println("Short Notification...");
vibrateNotificationShort();
delay(2000);
Serial.println("Standard Notification...");
vibrateNotification();
delay(2000);
Serial.println("Phone Call...");
vibratePhoneCall();
delay(2000);
}
관련 글
lv_conf.h
lv_conf.h — c source code from the Arduino learning materials (Arduino/CCIT4080_CL05_PKPD_Group2/lv_conf.h).
글 읽기 →2.4_max30102.cpp
2.4_max30102.cpp — cpp source code from the Arduino learning materials (Arduino/CCIT4080_CL05_PKPD_Group2/src/Combination/2.4_and_max30102_test/2.4_max30102.cpp).
글 읽기 →bluetooth.cpp
bluetooth.cpp — cpp source code from the Arduino learning materials (Arduino/CCIT4080_CL05_PKPD_Group2/src/Test_components/bluetooth_test/bluetooth.cpp).
글 읽기 →1.69_inch_display.cpp
1.69_inch_display.cpp — cpp source code from the Arduino learning materials (Arduino/CCIT4080_CL05_PKPD_Group2/src/Test_components/display_test/1.69_inch_display/1.69_inch_display.cpp).
글 읽기 →2.4_inch_display.cpp
2.4_inch_display.cpp — cpp source code from the Arduino learning materials (Arduino/CCIT4080_CL05_PKPD_Group2/src/Test_components/display_test/2.4_inch_display/2.4_inch_display.cpp).
글 읽기 →2.4_inch_touch.cpp
2.4_inch_touch.cpp — cpp source code from the Arduino learning materials (Arduino/CCIT4080_CL05_PKPD_Group2/src/Test_components/display_test/2.4_inch_touch/2.4_inch_touch.cpp).
글 읽기 →