Push Button

Liam Brady

Push buttons are momentary switches; you press down on the button, and it completes the circuit. You release the button, and the circuit is once again open.

void setup() {
  Serial.begin(9600);
  pinMode(8, INPUT_PULLUP);
}

void loop() {
  if (digitalRead(8) == false) {
    Serial.println(“Button is pressed.”);
  }
  delay(100);
}

Arduino Motor Shield Introduction

Aaron Laniosz
Adafruit_Motor_Shield_V2_Library.zip
EnableInterrupt.zip
RCPulseIn.zip

#include <Wire.h>
#include <Adafruit_MotorShield.h>

Adafruit_MotorShield AFMS = Adafruit_MotorShield();

Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
//Adafruit_DCMotor *myMotor = AFMS.getMotor(2);

void setup() {
     AFMS.begin();
}

void loop() {
     myMotor->setSpeed(255);
     myMotor->run(FORWARD);
     delay(1000);
}

Ultrasonic Sensor (Large)

Liam Brady

Ultrasonic sensors are distance sensors that use sound waves to detect how far away an object is. They send out high frequency bursts of sound and listen for its echo. They then determine how far away the object is based on how long it takes for the sound to return to the sensor. This variety requires an Arduino library to operate.

 

NewPing Library

#include <NewPing.h>

NewPing mysensor(5, 6, 200);

void setup() {
  Serial.begin(9600);
}

void loop() {
  int pingTime = mysensor.ping();

  int distance = mysensor.ping_in();

  int distance_cm = mysensor.ping_cm();

  Serial.println(distance);
}

Arduino Part 1: Installation

Max Vanatta

Welcome to Arduino!

The first step in learning Arduino is to download the software.  This can be found at arduino.cc.  There are the step by step instructions in the images above.  

It is recommended to make sure that the install has worked by opening the arduino app on your computer.  In our next tutorial, we will go through how to use this interface and connect it to your physical Arduino device.

NOTE

If you have a chromebook, you will not be able to use this method and instead will need to create an account on Arduino Create to gain access to the web editor version.