TinyUSBboard/Blink

Test your TinyUSBboard in the Arduino IDE with the following blink sketch.

/*
  TinyUSBboardBlink
  Turn on 4 LED's in counterclockwise rotation repeatedly.

  This example code is in the public domain.
 */

// Pin 3, 5, 9, 8 have LED's connected on TinyUSBboard.
int led1 = 3;
int led2 = 5;
int led3 = 8;
int led4 = 9;

// clockwise rotation
//int led1 = 9;
//int led2 = 8;
//int led3 = 5;
//int led4 = 3;

void setup() {                
  // initialize  output.
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);  
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led1, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);  // wait
  digitalWrite(led1, LOW);    // turn the LED off by making the voltage LOW
  delay(50);  // wait
  digitalWrite(led2, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);  // wait
  digitalWrite(led2, LOW);    // turn the LED off by making the voltage LOW
  delay(50);  // wait
  digitalWrite(led3, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);  // wait
  digitalWrite(led3, LOW);    // turn the LED off by making the voltage LOW
  delay(50);  // wait
  digitalWrite(led4, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);  // wait
  digitalWrite(led4, LOW);    // turn the LED off by making the voltage LOW
  delay(50);  // wait
}

Labels: TinyUSBboard

This page was last edited by BauweBijl on 2021/05/17 10:55:55.

Built with BGAEWiki by BauweBijl