Cov txheej txheem:

Kev Nyuaj Siab Zam Tsis Siv Neeg Tsheb Tsheb: 9 Kauj Ruam
Kev Nyuaj Siab Zam Tsis Siv Neeg Tsheb Tsheb: 9 Kauj Ruam

Video: Kev Nyuaj Siab Zam Tsis Siv Neeg Tsheb Tsheb: 9 Kauj Ruam

Video: Kev Nyuaj Siab Zam Tsis Siv Neeg Tsheb Tsheb: 9 Kauj Ruam
Video: ib sim cas tsis tsim nyog tsom xyooj 2022 2024, Kaum ib hlis
Anonim
Muaj Kev Nyuaj Siab Zam Lub Tsheb Robotic
Muaj Kev Nyuaj Siab Zam Lub Tsheb Robotic
Muaj Kev Nyuaj Siab Zam Lub Tsheb Robotic
Muaj Kev Nyuaj Siab Zam Lub Tsheb Robotic

Yuav Ua Li Cas Tsim Kom Muaj Kev Nyuaj Siab Zaum Tsis Siv Neeg

Kauj Ruam 1: Lub Thawv Dub

Lub Thawv Dub
Lub Thawv Dub

thawj kauj ruam kuv siv lub thawv dub ua lub hauv paus rau kuv tus neeg hlau.

Kauj ruam 2: Arduino

Arduino
Arduino

Arduino yog lub hlwb ntawm tag nrho cov kab ke thiab tsim kho peb cov tshuab

Kauj Ruam 3: Txuas Arduino rau Blackbox

Txuas Arduino rau Blackbox
Txuas Arduino rau Blackbox

Kuv txuas cov arduino rau lub blackbox siv cov kua nplaum kub

Kauj Ruam 4: Ultrasonic Sensor

Ultrasonic Sensor
Ultrasonic Sensor

Txhawm rau ua tus neeg hlau uas tuaj yeem txav tau los ntawm nws tus kheej peb xav tau qee yam ntawm cov tswv yim, lub ntsuas uas haum rau peb lub hom phiaj. Lub ntsuas hluav taws xob ultrasonic yog ntsuas uas ntsuas qhov nrug deb ntawm ib qho khoom siv siv lub suab tsis zoo. Ib qho ultrasonic sensor siv tus hloov pauv xa thiab tau txais ultrasonic pulses uas xa rov qab cov ntaub ntawv hais txog qhov khoom nyob ze

Kauj Ruam 5: Breadboard Kev Sib Txuas ntawm Sensor rau Arduino

Breadboard Kev Sib Txuas ntawm Sensor rau Arduino
Breadboard Kev Sib Txuas ntawm Sensor rau Arduino
Breadboard Kev Sib Txuas ntawm Sensor rau Arduino
Breadboard Kev Sib Txuas ntawm Sensor rau Arduino

Kuv siv cov xov hlau rau txiv neej kev sib txuas ntawm lub khob cij thiab arduino.

Ua tib zoo saib tias koj lub ping sensor yuav muaj tus lej sib txawv tab sis nws yuav tsum muaj tus pin voltage, tus pin hauv av, tus lej pin thiab tus echo pin.

Kauj Ruam 6: Tsav Tsheb

Lub Cev Tsav Tsheb
Lub Cev Tsav Tsheb

Arduino cov laug cam tsis tuaj yeem tswj lub tshuab hluav taws xob dc los ntawm lawv tus kheej, vim tias cov hluav taws xob uas lawv tsim tawm qis dhau. Txhawm rau daws qhov teeb meem no peb siv lub tshuab tiv thaiv lub cev. Qhov tiv thaiv lub cev muaj 2 txoj hauv kev, uas tso cai rau kev tswj ntawm ob lub DC motors, lossis 1 stepper tsav. … Los ntawm kev hais qhia cov pins no koj tuaj yeem xaiv lub cav kom pib, qhia lub zog tsav (kev sib txhuam), teeb tsa lub cev muaj zog (PWM), nres thiab pib lub cav, thiab saib xyuas qhov nqus tam sim no ntawm txhua cov channel

Kauj Ruam 7: Txuas Lub Tshuab Tsav Tsheb mus rau Arduino

Txuas Lub Tshuab Tsav Tsheb mus rau Arduino
Txuas Lub Tshuab Tsav Tsheb mus rau Arduino

Cias txuas daim ntawv tsav tsheb mus rau arduino nrog lub xov tooj cua sensor tawg hauv

Kauj Ruam 8: Txuas 4 Lub Tshuab Hluav Taws Xob thiab Roj Teeb rau Shield

Txuas 4 Motors thiab Roj Teeb rau Shield
Txuas 4 Motors thiab Roj Teeb rau Shield

Txhua Lub Tshuab Tsav Tsheb muaj (tsawg kawg) ob txoj hauv kev, ib qho rau lub cav, thiab ib qho rau lub zog siv, Txuas lawv nrog kev sib hwm

Kauj Ruam 9: Program Robot

khiav cov cai no

#ncig #ncig

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;

#define TRIG_PIN A2 #define ECHO_PIN A3 #define MAX_DISTANCE 150 #define MAX_SPEED 100 #define MAX_SPEED_OFFSET 10

boolean GoForward = tsis tseeb; int nrug = 80; int speedSet = 0;

void teeb tsa () {

myservo.attach (10); myservo.write (115); ncua (2000); nrug = readPing (); ncua (100); nrug = readPing (); ncua (100); nrug = readPing (); ncua (100); nrug = readPing (); ncua (100); }

void loop () {int nrug R = 0; int nrug L = 0; ncua (40); yog (nrug <= 15) {moveStop (); ncua (50); moveBackward (); ncua (150); moveStop (); ncua (100); nrugR = lookRight (); ncua (100); distanceL = saibLeft (); ncua (100);

yog (nrug R> = nrug L) {tig rov qab (); moveStop (); } lwm {turnLeft (); moveStop (); }} lwm tus {moveForward (); } nrug = readPing (); }

int saibRight () {myservo.write (50); ncua (250); int nrug = readPing (); ncua (50); myservo.write (100); rov nrug deb; }

int saibLeft () {myservo.write (120); ncua (300); 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 = 200; } rov cm; }

tsis muaj dabtsis moveStop () {motor1.run (tso tawm); motor2.run (tso tawm); motor3.run (tso tawm); motor4.run (tso tawm); } tsis muaj dabtsis moveForward () {

yog (! goForward) {goForward = muaj tseeb; motor1.run (FORWARD); motor2.run (FORWARD); motor3.run (FORWARD); motor4.run (FORWARD); rau (speedSet = 0; speedSet <MAX_SPEED; speedSet += 2) {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 (rov qab); motor3.run (rov qab); motor4.run (rov qab); rau (speedSet = 0; speedSet <MAX_SPEED; speedSet += 2) {motor1.setSpeed (speedSet); motor2.setSpeed (speedSet); motor3.setSpeed (speedSet); motor4.setSpeed (speedSet); ncua (5); } void turnLeft () {motor1.run (BACKWARD); motor2.run (rov qab); motor3.run (FORWARD); motor4.run (FORWARD); ncua (500); motor1.run (FORWARD); motor2.run (FORWARD); motor3.run (FORWARD); motor4.run (FORWARD); }

void turnLeft () {motor1.run (BACKWARD); motor2.run (rov qab); motor3.run (FORWARD); motor4.run (FORWARD); ncua (500); motor1.run (FORWARD); motor2.run (FORWARD); motor3.run (FORWARD); motor4.run (FORWARD); }

Pom zoo: