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
| /* | |
| * Some work created by Dejan Nedelkovski, | |
| * www.HowToMechatronics.com | |
| * | |
| */ | |
| #include <Adafruit_NeoPixel.h> | |
| // defines pins numbers | |
| const int trigPin = 13; | |
| const int echoPin = 12; |
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
| /* | |
| * Some work created by Dejan Nedelkovski, | |
| * www.HowToMechatronics.com | |
| * | |
| */ | |
| #include <Adafruit_NeoPixel.h> | |
| // defines pins numbers | |
| const int trigPin = 13; | |
| const int echoPin = 12; |
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
| /* | |
| * Ultrasonic Sensor HC-SR04 and Arduino Tutorial | |
| * | |
| * Created by Dejan Nedelkovski, | |
| * www.HowToMechatronics.com | |
| * | |
| */ | |
| // defines pins numbers | |
| const int trigPin = 13; |
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
| /* | |
| Stepper Motor Control - one revolution | |
| This program drives a unipolar or bipolar stepper motor. | |
| The motor is attached to digital pins 8 - 11 of the Arduino. | |
| The motor should revolve one revolution in one direction, then | |
| one revolution in the other direction. | |
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
| const int switchPin = 2; // switch input | |
| const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) | |
| const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A) | |
| const int enablePin = 9; // H-bridge enable pin | |
| void setup() { | |
| pinMode(switchPin, INPUT); | |
| pinMode(motor1Pin, OUTPUT); | |
| pinMode(motor2Pin, OUTPUT); | |
| pinMode(enablePin, HIGH); |
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
| #include <Servo.h> | |
| Servo myServo; | |
| void setup() { | |
| Serial.begin(9600); | |
| myServo.attach(3); | |
| } |
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
| /* | |
| This P5 sketch is a template for getting started with Serial Communication. | |
| The SerialEvent callback is where incoming data is received | |
| By Arielle Hein, adapted from ITP Phys Comp Serial Labs | |
| Edited March 13 2018 | |
| */ |
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
| /* | |
| This P5 sketch is a template for getting started with Serial Communication. | |
| The SerialEvent callback is where incoming data is received | |
| By Arielle Hein, adapted from ITP Phys Comp Serial Labs | |
| Edited March 13 2018 | |
| */ |
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
| void setup() { | |
| Serial.begin(9600); | |
| } | |
| void loop() { | |
| //read our sensor values | |
| int sensor1 = analogRead(A0); | |
| delay(1); | |
| int sensor2 = analogRead(A1); |