Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino 101 LED Control with Push Button

View and Edit Project In Cirkit DesignerImage of Arduino 101 LED Control with Push Button

Circuit Documentation

Summary

This circuit consists of an Arduino 101 microcontroller, a green LED, and a 2-pin push switch. The circuit is designed to control the LED using the push button. When the button is pressed, the LED turns on, and when the button is released, the LED turns off.

Component List

  1. Arduino 101

    • Description: A microcontroller board based on the Intel Curie module.
    • Pins: A5/SCL, A4/SDA, AREF, GND, D13/SCK, D12/MISO, D11 PWM/MOSI, D10 PWM/SS, D9 PWM, D8, D7, D6 PWM, D5 PWM, D4, D3 PWM, D2, D1/TX, D0/RX, AIN, ioref, RESET, 3V3, 5V, VIN, A0, A1, A2, A3, ICSP MISO, ICSP SCK, ICSP MOSI
  2. LED: Two Pin (green)

    • Description: A green LED with two pins, anode and cathode.
    • Pins: cathode, anode
  3. 2Pin Push Switch

    • Description: A simple push button switch with two pins.
    • Pins: Input +, Output +

Wiring Details

Arduino 101

LED: Two Pin (green)

2Pin Push Switch

Code

Arduino 101 Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

2Pin Push Switch Code

/*
 * This Arduino sketch controls an LED using a push button.
 * When the button is pressed, the LED turns on. When the button is released,
 * the LED turns off.
 */

const int buttonPin = 7; // Pin connected to the push button
const int ledPin = 2;    // Pin connected to the LED

void setup() {
  // Initialize the button pin as an input
  pinMode(buttonPin, INPUT);
  // Initialize the LED pin as an output
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // Read the state of the push button
  int buttonState = digitalRead(buttonPin);
  // If the button is pressed, turn on the LED
  if (buttonState == HIGH) {
    digitalWrite(ledPin, HIGH);
  } else {
    // Otherwise, turn off the LED
    digitalWrite(ledPin, LOW);
  }
}

This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used for the microcontroller.