Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Kev sib txuas
- Kauj Ruam 2: Kuaj tag nrho cov ntsiab lus hauv qhov chaw
- Kauj ruam 3: PROGRAMMING
Video: Yuav Ua Li Cas Ntse Tus Neeg Hlau Siv Arduino: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
nyob zoo,
Kuv yog tus tsim arduino thiab hauv qhov kev qhia no kuv yuav qhia koj tias yuav ua li cas thiaj ua tau ntse neeg hlau siv arduino
yog tias koj nyiam kuv cov lus qhia ces txiav txim siab txhawb nqa kuv tus youtube channel npe hu ua tus tsim arduino
Khoom siv
Tej yam koj yuav tsum tau:
1) arduino ib
2) ultrasonic sensor
3) Bo lub cev muaj zog
4) lub log
5) khov nab kuab
6) Roj teeb 9v
Kauj ruam 1: Kev sib txuas
Tom qab, tau txais txhua yam khoom siv tam sim no koj yuav tsum pib txuas txhua yam raws li daim duab qhia chaw hauv qab no
Kauj Ruam 2: Kuaj tag nrho cov ntsiab lus hauv qhov chaw
OK,
tam sim no txuas txhua yam hauv qhov chaw raws li qhia hauv daim duab saum toj no
Kauj ruam 3: PROGRAMMING
Tam sim no,
pib tsim lub rooj tsavxwm nrog cov lej muab hauv qab no
// ARDUINO OBSTACLE AVOIDING CAR //// Ua ntej rub tawm cov cai koj yuav tsum teeb tsa lub tsev qiv ntawv tsim nyog // // AFMotor Library https://learn.adafruit.com/adafruit-motor-shield/library-install // NewPing Library https://github.com/livetronic/Arduino-NewPing// // Servo Library https://github.com/arduino-libraries/Servo.git // // Txhawm rau nruab cov tsev qiv ntawv mus rau kos duab >> suav nrog Lub Tsev Qiv Ntawv >> Ntxiv. ZIP Cov Ntaub Ntawv >> Xaiv cov rub tawm ZIP cov ntaub ntawv Los ntawm cov kab ntawv saum toj no //
#suav nrog
#suav nrog
#suav nrog
#define TRIG_PIN A0
#define ECHO_PIN A1 #define MAX_DISTANCE 200
#define MAX_SPEED 150 // teeb tsa ceev ntawm DC lub cav
#define MAX_SPEED_OFFSET 20
NewPing sonar (TRIG_PIN, ECHO_PIN, MAX_DISTANCE);
AF_DCMotor motor1 (1, MOTOR12_1KHZ);
// AF_DCMotor motor2 (2, MOTOR12_1KHZ); // AF_DCMotor motor3 (3, MOTOR34_1KHZ); AF_DCMotor motor4 (4, MOTOR34_1KHZ); Servo tswj;
boolean GoForward = tsis tseeb;
int nrug = 100; int speedSet = 0;
void teeb tsa () {
myservo.attach (10);
myservo.write (115); ncua (1000); nrug = readPing (); ncua (100); nrug = readPing (); ncua (100); nrug = readPing (); ncua (100); nrug = readPing (); ncua (100); }
void voj () {
int nrug R = 0; int nrug L = 0; ncua (40); yog (nrug <= 15) {moveStop (); ncua (100); moveBackward (); ncua (300); moveStop (); ncua (200); nrugR = lookRight (); ncua (300); distanceL = saibLeft (); ncua (300);
yog (nrug R> = nrug L)
{tig rov qab (); moveStop (); } lwm {turnLeft (); moveStop (); }} lwm tus {moveForward (); } nrug = readPing (); }
int saibRight ()
{myservo.write (50); ncua (650); int nrug = readPing (); ncua (100); myservo.write (115); rov nrug deb; }
koj zooLeft ()
{myservo.write (170); ncua (650); int nrug = readPing (); ncua (100); myservo.write (115); rov nrug deb; ncua (100); }
int readPing () {
ncua (70); int cm = sonar.ping_cm (); yog (cm == 0) {cm = 250; } rov cm; }
tsis muaj dabtsis moveStop () {
motor1.run (tso tawm); //motor2.run(RELEASE); //motor3.run(RELEASE); motor4.run (tso tawm); } tsis muaj dabtsis moveForward () {
yog tias (! goForward)
{goForward = muaj tseeb; motor1.run (FORWARD); //motor2.run(FORWARD); //motor3.run(FORWARD); motor4.run (FORWARD); rau (speedSet = 0; speedSet <MAX_SPEED; speedSet += 2) // maj mam nqa nrawm kom tsis txhob ntsaws lub roj teeb nrawm dua {motor1.setSpeed (speedSet); //motor2.setSpeed(speedSet); //motor3.setSpeed(speedSet); motor4.setSpeed (speedSet); ncua (5); }}}
void moveBackward () {
GoForward = tsis tseeb; motor1.run (rov qab); //motor2.run(BACKWARD); //motor3.run(BACKWARD); motor4.run (rov qab); rau (speedSet = 0; speedSet <MAX_SPEED; speedSet += 2) // maj mam nqa nrawm kom tsis txhob ntsaws lub roj teeb nrawm dua {motor1.setSpeed (speedSet); //motor2.setSpeed(speedSet); //motor3.setSpeed(speedSet); motor4.setSpeed (speedSet); ncua (5); }}
void turnRight () {
motor1.run (rov qab); //motor2.run(BACKWARD); //motor3.run(FORWARD); motor4.run (FORWARD); ncua (350); motor1.run (FORWARD); //motor2.run(FORWARD); //motor3.run(FORWARD); motor4.run (FORWARD); } void turnLeft () {motor1.run (FORWARD); //motor2.run(FORWARD); //motor3.run(BACKWARD); motor4.run (rov qab); ncua (350); motor1.run (FORWARD); //motor2.run(FORWARD); //motor3.run(FORWARD); motor4.run (FORWARD); }
Pom zoo:
DIY -- ua Yuav Ua Li Cas Tus Neeg Hlau Spider Uas Yuav Tswj Tau Siv Smartphone Siv Arduino Uno: 6 Cov Kauj Ruam
DIY || ua Yuav Ua Li Cas Spider Robot Uas Yuav Tswj Tau Siv Smartphone Siv Arduino Uno: Thaum ua Spider neeg hlau, ib tus tuaj yeem kawm ntau yam txog kev siv neeg hlau.Like ua Robots yog Kev lom zem nrog rau kev nyuaj. Hauv daim vis dis aus no peb yuav qhia koj yuav ua li cas thiaj ua Spider neeg hlau, uas peb tuaj yeem ua haujlwm siv peb lub xov tooj smartphone (Androi
YUAV UA LI CAS YUAV UA LI CAS YUAV TSUM MUAJ KEV LAG LUAM CIRCUIT Siv D882 Tus Neeg Soj Ntsuam: 3 Kauj Ruam
YUAV UA LI CAS YUAV UA LI CAS YUAV TSUM TAU LWM YAM CIRCUIT Siv D882 Tus Kws Tshaj Lij: HELLO phooj ywg, Zoo siab txais tos rau kuv CHANNEL, Hnub no kuv yuav qhia koj li cas kom ua tau CIRCUIT ntawm kev siv hluav taws xob tsis siv neeg lub teeb pom kev siv D882
Yuav Ua Li Cas Tus Kab Raws Li Tus Neeg Hlau Tsis Siv Arduino (Microcontroller): 5 Kauj Ruam
Yuav Ua Li Cas Ua Tus Follower Robot Tsis Siv Arduino (Microcontroller): Hauv qhov kev qhia no, kuv yuav qhia koj yuav ua li cas ua kab tom qab tus neeg hlau tsis siv Arduino.Kuv yuav siv cov kauj ruam yooj yim heev los piav qhia. ua raws kab ntawv Koj yuav tsis xav tau ib qho kev paub ua haujlwm zoo rau
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
Ntsuas Neeg Hlau / 3 Log Neeg Hlau / STEM Neeg Hlau: 8 Kauj Ruam
Ntsuas Cov Neeg Hlau / 3 Log Neeg Hlau / STEM Neeg Hlau: Peb tau tsim ua ke sib npaug thiab 3 lub log neeg hlau rau kev kawm siv hauv tsev kawm ntawv thiab tom qab kawm ntawv cov haujlwm. Tus neeg hlau yog ua raws Arduino Uno, tus tiv thaiv kev tiv thaiv (txhua qhov kev tsim kho cov ntsiab lus muab), Li -Ion roj teeb pob (txhua qhov tsim tawm