2016互動技術
2016年11月21日 星期一
Week 12
1. Button
https://www.arduino.cc/en/Tutorial/Button
void setup()
{
pinMode(13,OUTPUT);
pinMode(2,INPUT);
}
void loop()
{
int result = digitalRead(2);
if(result==HIGH) digitalWrite(13,HIGH);
else digitalWrite(13,LOW);
}
2. DigitalInputPullup
3. AnalogInput
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言