Robojax Crash Course on Arduino: Learn Arduino in 30 Minutes: Servo Motor
Robojax Crash Course on Arduino: Learn Arduino in 30 Minutes: Servo Motor
Learn Arduino from scratch. Step by step from proven instructor with years of experience. The course will start on getting and installing Arduino software, then Arduino boards are introduced and practically projects are shown with wiring diagram and how to wire them. All the codes are provided for download. .
Codes for this coruse:-Robojax Crash Cours on Arduion: Touch Sensor
-Robojax Crash Cours on Arduion: For Loop
-Robojax Crash Cours on Arduion: Servo Control
-Robojax Crash Cours on Arduion: AC bulb, Relay
-Robojax Arduino Comperhensive Course on Udemy
Topics of this course
- 00:00 Getting Arduino Software
- 03:56 Arduino Boards
- 05:14 Arduino UNO explained
- 07:00 LED Blink
- 10:53 if statement
- 18:07 for loop
- 20:36 Fading LED
- 23:00 Reading Voltage
- 26:30 Servo control
- 28:58 Controlling AC bulb with Relay
- 32:01 Touch Sensor
- Robojax Crash Cours on Arduion: Touch Sensor
- Robojax Crash Cours on Arduion: For Loop
- Robojax Crash Cours on Arduion: AC bulb, Relay
- Robojax Arduino Comperhensive Course on Udemy
- Get Early Access to my videos via Patreon
Resources for this sketch
Basic code to control direction of rotation of motor with 2 relay
/*
* Servo Sweep code: Robojax Crash Course on Arduino: Learn Arduino in 30 Minutes
*
* Watch video instruction :https://youtu.be/Mbb2xa1WcRM
*
Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*
* This code has been download from Robojax.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}