- 막달운동
- sony nex vg20
- 도쿄지헨
- OPT #EAD
- wall display raspberrypi
- 동경사변
- 라즈베리파이 모니터벽
- 東京事変
- 4대 대첩
- 세운전자상가
- 유학생 건강검진
- raspberrypi wifi
- formex E400
- 러쉬 해외 직구
- 세실내과
- 라즈베리파이 와이파이
- formex
- Skins
- 흥성전기
- 인천작업실
- piwall
- 이슬비침
- 시이나링고
- Arduino
- 시온여성병원
- 東京事變
- IR sensor
- 월디스플레이
- Shena Ringo
- 파이월
- Today
- Total
'_'
S.O.S code for Arduino 본문
http://www.instructables.com/id/SOS-signal-with-an-arduino/
<방법
CODE
Connect the usb to your arduino and cannect the led to pin 12 (13 if your using the on board led)
Than when your done that copy and paste the sketch
------------------------------------------------------------------------------------------------------------------
// This sketch will allow cause a led to do a SOS(sos) signal
int ledPin = 12; // LED connected to digital pin 12
// The setup() method runs once, when the sketch starts
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(3000); // 3 second delay wich acts 1: before loop to make sure your ready and 2: act as a delay for when it starts all over again :)
digitalWrite(ledPin, HIGH); //"S" signal starts after the one second delay
delay(1000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(3000); //3 second delay for the second letter (fisrt of 2)
digitalWrite(ledPin, HIGH);
delay(3000); // First dash of 3 wich represents the O
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(3000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(3000);
digitalWrite(ledPin, LOW);
delay(3000); //second 3 second delay for the third letter
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
}
ANOTHER ver
It is a short code and more convenient to adjust !
----------------------------------------------------------------------------------------------------------------
// This sketch will allow cause a led to do a SOS signal
int ledPin = 5; // LED connected to digital pin 12
int s = 300; // 0,3 second delay for 'S' letter
int o = 800; // 0,8 second delay for 'O' letter
int pause = 100; // 0,1 second delay between letters
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
}
void character(int speed, int pause) {
for (int i = 1; i <= 3; i++) {
digitalWrite(ledPin, HIGH);
delay(speed);
digitalWrite(ledPin, LOW);
delay(300);
}
delay(pause); //delay between letters
}
void loop() {
character(s,pause);
character(o,pause);
character(s,pause);
delay(2000); //2 seconds delay for after the word SOS
}
'자료용' 카테고리의 다른 글
리히터<4096가지색채>_임근준 (0) | 2017.07.13 |
---|---|
sweep_motor_채찍질 (0) | 2017.07.09 |
윈도우 화면캡쳐 및 화면녹화 단축키 (0) | 2017.06.18 |
아두이노 - 릴레이이용한 가정용품제어 (0) | 2017.06.16 |
청계 세운전자상가 솔레노이드 및 전원 구입처 (0) | 2017.06.13 |