목차
[WAT-S048] 진동 발생 모듈(진동 크기 조절 가능)
본 제품은 키트128 센서키트(초급) 중 48번째 모듈로 진동 발생 모듈입니다.

핀 번호
| 번호 | I/O | 기능 |
|---|---|---|
| 1 | S | Signal |
| 2 | + | VCC |
| 3 | – | GND |
Arduino UNO R3 예제
핀 연결
| 번호 | I/O | UNO R3 |
|---|---|---|
| 1 | S | 9 |
| 2 | + | 5V |
| 3 | – | GND |
소스코드
최신 소스코드는 [파일]=>[예제]=>[WhiteAT UNO]=> [Sensor37] => [48_Vibration] 에 에 있으며
라이브러리는 아두이노 개발환경(https://docs.whiteat.com/?page_id=5449) 을 참조하세요
/*
키트128 센서키트(초급) 예제 중 48번째
UNO 와 [WAT-S048]진동 발생 모듈 예제입니다.
Arduino UNO R3 : https://kit128.com/goods/view?no=337
[WAT-S048]진동 발생 모듈 : https://kit128.com/goods/view?no=448
출처: http://docs.whiteat.com
*/
int S = 9; // use PIN 9
// 프로그램 초기화
void setup()
{
// 신호 핀을 출력으로 설정
pinMode(S, OUTPUT);
analogWrite(S, 0);
}
// 계속 실행할 무한 루프
void loop()
{
delay(2000); // wait for a second
analogWrite(S, 0); // 0% Vibration
delay(2000); // wait for a second
analogWrite(S, 102); // 40% Vibration
delay(2000); // wait for a second
analogWrite(S, 180); // 70% Vibration
delay(2000); // wait for a second
analogWrite(S, 255); // 100% Vibration
}
결과 화면
1초 간격으로 진동크기가 변합니다.
제품 구매
Arduino UNO R3 (아두이노 우노)은 https://kit128.com/goods/view?no=337에서
[WAT-S048] 진동 발생 모듈은 https://kit128.com/goods/view?no=448 에서 구매하실 수 있습니다.
