Skip to content

Instantly share code, notes, and snippets.

View nortbotics's full-sized avatar

Nortbotics nortbotics

View GitHub Profile
@nortbotics
nortbotics / Pan_Tilt_w_VarSpeedServo
Created November 17, 2014 23:59
Pan & Tilt Example Using DFRobot 270 degree Servos
// NORTBOTICS
// Pan & Tilt Example Using DFRobot 270 degree Servos
// CC BY SA 4.0 (Use as you wish, but share-alike and give credit)
#include <VarSpeedServo.h>
VarSpeedServo myservo1;
VarSpeedServo myservo2;
const int servoPin1 = 10; // the digital pin used for the servo
@nortbotics
nortbotics / NewPingSinglePin
Created November 7, 2014 06:14
Running the HC-SR04 with A Single Pin Using NewPing
// ---------------------------------------------------------------------------
// NewPing library sketch that interfaces with all but the SRF06 sensor using
// only one Arduino pin. You can also interface with the SRF06 using one pin
// if you install a 0.1uf capacitor on the trigger and echo pins of the sensor
// then tie the trigger pin to the Arduino pin (doesn't work with Teensy).
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define PING_PIN 12 // Arduino pin tied to both trigger and echo pins on the ultrasonic sensor.
// ---------------------------------------------------------------------------
// Example NewPing library sketch that does a ping about 20 times per second.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN 11 // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.