2015年11月23日 星期一

|| 02160562 || 洪伊盈 || Week 11 || ARDUINO訊號輸出 五燈全亮





----------------------------------------------------------------------------------------------------------------------------------------------

// the setup function runs once when you press reset or power the board void setup()
{
// initialize digital pin 13 as an output. pinMode(9, OUTPUT);
pinMode(10, OUTPUT); pinMode(11, OUTPUT); pinMode(12, OUTPUT); pinMode(13, OUTPUT); } // the loop function runs over and over again forever void loop()
{
for(int i=9;i<=13;i++) { digitalWrite(i, HIGH); // turn the LED on (HIGH is the voltage level) delay(500); // wait for a second digitalWrite(i, LOW); // turn the LED off by making the voltage LOW delay(500); // wait for a second } }

沒有留言:

張貼留言