串口 — Arduino Mega simulation

An interactive Arduino Mega circuit simulation you can run free in your browser on Velxio, by bxxbx.

Components

Sketch code

// Arduino Blink Example
#define BUTTON_PIN 2
#define LEDPIN 11
void setup() {
  pinMode(BUTTON_PIN, INPUT);
  pinMode(LEDPIN, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  if (digitalRead(BUTTON_PIN)==HIGH) {
    digitalWrite(LEDPIN, HIGH);
    Serial.println("on");
    
  }
  delay(100);
}

More projects by bxxbx