Selected Courses on Digital Art-UOWM

16 Νοεμβρίου 2014

ARDUINO09-Motorized Pinwheel

Filed under: ARDUINO,NOTES ON INTERACTIVE ART — admin @ 13:34

const int switchPin = 2;
const int motorPin = 9;

int switchState = 0;

void setup() {
  pinMode(motorPin, OUTPUT);
  pinMode(switchPin, INPUT);
}

void loop() {
  switchState = digitalRead(switchPin);
  
  if(switchState == HIGH){
    digitalWrite(motorPin, HIGH);
  }
  else {
    digitalWrite(motorPin, LOW);
  }
}



[youtube https://www.youtube.com/watch?v=6jY_dkWGakk]

[youtube https://www.youtube.com/watch?v=lHVZikxGXk0]

Δεν υπάρχουν Σχόλια

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress

error: Content is protected !!