Basic IO

// the setup function runs once when you press reset or power the board
void setup() {
  
  pinMode(PC5, OUTPUT); 
  pinMode(PC6, OUTPUT); 
  pinMode(PC7, OUTPUT);
  pinMode(PC8, OUTPUT); 
  pinMode(PC9, OUTPUT); 
  pinMode(PB1, OUTPUT); 

}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(PC5, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(200);                       // wait for a second
  digitalWrite(PC5, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(PC6, HIGH);    // turn the LED off by making the voltage LOW
  delay(200);                       // wait for a second

  digitalWrite(PC6, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(PC7, HIGH);    // turn the LED off by making the voltage LOW
  delay(200);                       // wait for a second

  digitalWrite(PC7, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(PC8, HIGH);    // turn the LED off by making the voltage LOW
  delay(200);                       // wait for a second

  digitalWrite(PC8, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(PC9, HIGH);    // turn the LED off by making the voltage LOW
  delay(200);                       // wait for a second

  digitalWrite(PC9, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(PB1, HIGH);    // turn the LED off by making the voltage LOW
  delay(200);                       // wait for a second
  digitalWrite(PB1, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);

}

Comments powered by CComment