Cov txheej txheem:

DIY Photography Slider: 4 Kauj Ruam
DIY Photography Slider: 4 Kauj Ruam

Video: DIY Photography Slider: 4 Kauj Ruam

Video: DIY Photography Slider: 4 Kauj Ruam
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Kaum ib hlis
Anonim
DIY Photography Slider
DIY Photography Slider

nyob zoo sawv daws! qhov no yog kuv qhov project rau DIY lub koob yees duab swb, kuv muaj lub sijhawm nyuaj nrog kuv, tab sis kuv paub tseeb tias koj ua tib zoo mloog kom ntxaws nws yuav ua haujlwm!

hauv kev xav, qhov no yuav tsum ua haujlwm tag nrho

yog tias koj xaiv ua qhov no kuv vam tias koj yuav txaus siab rau nws!

Kauj Ruam 1: Sau Koj Cov Khoom

Sau Koj Cov Khoom
Sau Koj Cov Khoom
Sau Koj Cov Khoom
Sau Koj Cov Khoom
Sau Koj Cov Khoom
Sau Koj Cov Khoom

Cov Khoom Siv Hluav Taws Xob

  • Arduino
  • ob 360 servos
  • mov ci pawg thawj coj saib
  • resistors
  • nyees khawm (nyiam dua 3)

Cov khoom siv hauv tsev

  • ob daim ua npuas ncauj
  • ntoo daim ntawm dowel (tuaj yeem yog hlau)
  • ntoo oval zoo li daim (xa mus rau daim duab intro duab).

Kauj ruam 2: Teeb tsa

Teeb tsa!
Teeb tsa!

daim duab no yog daim duab qhia chaw

ua raws qhov no thiab koj qhov haujlwm yuav ua haujlwm!

Kauj Ruam 3: Sib dhos Breadboard

Sib dhos ntawm Breadboard!
Sib dhos ntawm Breadboard!
  • ua ntej tshaj plaws txuas qhov zoo thiab hauv av rau lub khob cij.
  • thib ob txuas ob lub servos… thiab muaj ob lub xov hlau khiav mus rau hauv av thiab zoo, thiab lwm qhov rau tus pin koj yuav xaiv. (nco ntsoov cov cai yuav muaj tus pin kuv xaiv)..
  • tom qab ntawv sib sau koj cov nyees khawm… nco ntsoov txuas mus rau tus pin uas koj xaiv tab sis tus lej yuav tsis ua haujlwm yog tias koj tsis siv tus pin kuv xaiv. txuas cov nyees khawm rau hauv av ib yam nkaus.
  • thiab siv 220 resistor.
  • Thaum kawg, yog tias koj xav siv LCD saib koj yuav tsum txuas 2 tus pin rau cov tswv yim sib txuas thiab ib lub xov hlau mus rau lub davhlau ya nyob twg zoo.

Kauj ruam 4: Arduino Code

#include #include #include

LiquidCrystal_I2C lcd (0x27, 16, 2); // teeb tsa qhov chaw nyob LCD rau 0x27 rau 16 tus cim thiab 2 kab lus tso tawm

Servo tsav tsheb; // Txhais sab laug servo Servo servoRight; // Txhais txoj cai servo

const int pib = 8; // tus pin rau startbut (pib khawm) const int forwardbut = 12; // tus pin rau forwardbut (forwardbutton) const int reversebut = 13; // pin rau reversebut (reversebutton) int tim = 500; // tus nqi ntawm ncua sij hawm int flag = 0; int suav = 0;

char array1 = "zoo siab txais tos"; // txoj hlua los luam tawm ntawm LCD ("zoo siab txais tos") char array2 = "thawb sab laug = LEFT, sab xis = RIGHT!"; // txoj hlua los luam tawm ntawm LCD ("thawb sab laug = LEFT, sab xis = RIGHT")

teeb tsa tsis muaj dab tsi () {servoLeft.attach (10); // Teeb sab laug servo rau tus lej digital 10 servoRight.attach (9); // Teeb txoj cai servo rau tus lej digital 9 servoLeft.write (90); // teeb tsa servos rau 90 degrees servoRight.write (90); ncua (100);

// tig tus pin rau inputs pinMode (pib tab sis, INPUT); // initialize lub startbut (startbutton) raws li tus pin input hom (reversebut, INPUT); // pib lub reversebut (reversebutton) raws li tus pin input (forwardbut, INPUT); // initialize forwardbut (forwardbutton) raws li cov tswv yim

}

void loop () {// Loop los ntawm kev ntsuas txav // chaws rau LCD saib yog (chij == 1 && suav == 0) {suav = 1; lcd.init (); // pib lub lcd lcd.backlight (); // qhib lub teeb pom kev

lcd.setCursor (15, 0); // teeb tus cursor rau kab 15, kab 0 rau (int positionCounter1 = 0; positionCounter1 <26; positionCounter1 ++) {lcd.scrollDisplayLeft (); // Scrolls tus txheem ntawm cov zaub ib qhov chaw mus rau sab laug. lcd.print (array1 [positionCounter1]); // Luam tawm cov lus rau LCD. ncua (tim); // tos 250 microseconds} lcd.clear (); // Tshem tawm lub vijtsam LCD thiab tso tus cursor nyob rau kaum kaum sab saud. lcd.setCursor (15, 1); // teeb tus cursor rau kab 15, kab 1 rau (int positionCounter = 0; positionCounter <26; positionCounter ++) {lcd.scrollDisplayLeft (); // Scrolls tus txheem ntawm cov zaub ib qhov chaw mus rau sab laug. lcd.print (array2 [positionCounter]); // Luam tawm cov lus rau LCD. ncua (tim); // tos 250 microseconds} lcd.clear (); // Tshem tawm lub vijtsam LCD thiab tso tus cursor nyob rau kaum kaum sab saud. } //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// ////////////////////////////////////////

/kos yog tias cov nyees khawm nias yog (digitalRead (startbut) == 1) {chij = 1; // chij sib txawv rau khawm kom pib}

yog (chij == 1) {yog (digitalRead (reversebut) == HIGH) // reversebut nias yuav tig rau servo {thim rov qab (); // thim rov qab sib txawv rau reversebutton} lwm yog (digitalRead (forwardbut) == HIGH) // forwardbut nias yuav tig rau servo {rau pem hauv ntej (); // forward variable rau forwardbutton} lwm {stop (); // nres qhov sib txawv kom tsis txhob txav ntawm servos thaum khawm tsis nias}}

}

// Tsab ntawv tsa suab ua haujlwm rau pem hauv ntej, thim rov qab thiab nres qhov tsis muaj dab tsi rau pem hauv ntej () {// rau pem hauv ntej hais kom ua servoLeft.write (0); // kev taw qhia uas servos tig servoRight.write (180); } tsis muaj dab tsi nres () {// nres hais kom ua servoLeft.write (90); // nres ob qho kev pabcuam ntawm tib qhov chaw, txwv tsis pub lawv yuav nyob hauv cov haujlwm sib txawv servoRight.write (90); } tsis muaj qhov thim rov qab () {// thim rov qab hais kom ua servoLeft.write (180); // servos qhib rau hauv cov lus qhia rov qab servoRight.write (0); }

nov yog txoj cai kom ua tiav! tom qab koj tau teeb tsa koj cov arduino txhua yam yuav tsum ua haujlwm! thiab txaus siab!

yog tias nws tsis ua haujlwm nco ntsoov rov qab saib cov lus qhia no thiab tshawb xyuas txhua yam!

Pom zoo: