Last active
February 16, 2018 16:42
-
-
Save liz-miller/101f2d99353cd203ef15ef67509ba367 to your computer and use it in GitHub Desktop.
Four Steps to writing an Arduino Program Step 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
/* | |
*Title: My Awesome Arduino Program | |
*Author: Liz Miller | |
*Date: 02/15/2018 | |
*Version: v1.0 | |
*Purpose: This code shows you how to write an Arduino Program! | |
*/ | |
//STEP 2 - define all of your IO | |
const int led = 6; | |
const int ping = 5; | |
Servo myServo; | |
void setup() { | |
// put your setup code here, to run once: | |
myServo.attach(3); //servo on pin 3 | |
pinMode(led, OUTPUT); | |
pinMode(ping, INPUT); | |
Serial.begin(9600); //to initialize the serial monitor | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment