This file contains hidden or 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
| // 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 |
This file contains hidden or 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
| // --------------------------------------------------------------------------- | |
| // 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. |
This file contains hidden or 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
| // --------------------------------------------------------------------------- | |
| // 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. |