아두이노릴레이연결 |
int relay=10; void setup() { // put your setup code here, to run once: pinMode(relay,OUTPUT); }
void loop() { // put your main code here, to run repeatedly: digitalWrite(relay,HIGH); delay(5000); digitalWrite(relay,LOW); delay(5000); } |
http://makeshare.org/bbs/board.php?bo_table=arduinoetc&wr_id=14 |
수위감지센서연결 |
int relayPin=10; int WSPin=0; int val=0;
void setup() { // put your setup code here, to run once: pinMode(relayPin,OUTPUT); Serial.begin(9600); }
void loop() { // put your main code here, to run repeatedly: val=analogRead(WSPin);
if(val>100) digitalWrite(relayPin,HIGH); else digitalWrite(relayPin,LOW);
Serial.println(val); delay(500); } |
|
우노전력소비량 |
|
장비/디자인/구조
[아두이노] 수위를 감지해 자동 급수
by 라키 posted Aug 10, 2018