Cov txheej txheem:

Joking Tank: 5 Kauj Ruam
Joking Tank: 5 Kauj Ruam

Video: Joking Tank: 5 Kauj Ruam

Video: Joking Tank: 5 Kauj Ruam
Video: 50 cent-go shortly, It’s your birthday 2024, Kaum ib hlis
Anonim
Tso dag
Tso dag

Nov yog qhov haujlwm uas kuv tau ua ntawm kuv lub tsev kawm ntawv HKU, uas xav kom peb ua qee yam nrog Arduino Uno. Kuv xav ua qee yam uas yuav ua rau kuv nyiam tshaj plaws, ua rau tib neeg luag. Yog li txiav txim siab los ua lub thawv tso dag uas yuav ua rau koj tso dag, tab sis dab tsi tso dag nws tau muab rau koj yuav vam khom dab tsi ob peb ntawm cov ntsuas qhov ntsuas tau ntsuas ntawm lub sijhawm ntawd nyob rau lub sijhawm. Txhawm rau nws tus kheej ntau dua Kuv txiav txim siab ua nws lub tank.

Kauj Ruam 1: Tau Txais Cov Khoom

Cov ntu uas koj xav tau los tsim txoj haujlwm no yuav yog

  • 1x lub computer muaj peev xwm khiav Arduino IDE
  • 1 x Arduino Uno
  • 1x usb txuas cable rau Arduino Uno
  • 1 x Sonar sensor
  • 1x Tus Hais Lus (nyiam dua ib qho ntawm qhov ua tau zoo (, Kuv tau siv ib qho kuv rub tawm ntawm tus hais lus bluetooth)).
  • 1x LM386 Amplifier module (nws tuaj yeem ua qhov no rau koj tus kheej tab sis kuv siv tus qauv).
  • 1 x LM393 Microphone
  • 1 x LDR
  • 1x LED (txhua xim yuav ua tab sis kuv siv xiav).
  • 4x 1 kΩ resistor
  • 1x 2, 7kΩ resistor
  • 1 x Breadboard
  • 1x micro SD daim npav (tshwj xeeb tshaj yog me me (1 lossis 2 gb)).
  • 1 x Lub cev muaj zog.
  • 1x16mm lub taub hau (tshwj xeeb tshaj yog ua rau cov hlau hlau).
  • 1x9mm lub taub hau (tseem nyiam ua rau drilling hlau)
  • 1x 1mm lub taub hau (zoo dua ua rau drilling hlau)
  • 1x Lub tank qauv (Kuv siv 1:35 teev tsov txaij 2 tab sis lwm qhov xwm txheej yuav tsum zoo ib yam)
  • Superglue / hotglue
  • thiab qee qhov xov hlau zoo dua hauv cov xim sib txawv.
  • cable sib txuas (yeem).

Kauj ruam 2: Kev thaiv kab

Thaiv
Thaiv

Peb yuav tsum tau pib nrog cov xov hlau, cov duab yog kev kos duab ntawm yuav ua li cas txhua tus yuav tsum tau siv kab no Qhov no yuav tsum ua haujlwm raws li koj daim qauv txheej txheem. Arduino yog AP4, chaw nres nkoj A0 yog APA0 thiab chaw nres nkoj 6 ~ yog AP6 ~, thiab lwm yam

Kauj ruam 3: Pre Code Yam

Tam sim no ua ntej peb tuaj yeem pib siv cov cai peb xav tau qee qhov stuf. Kuv pom zoo koj tam sim no ua raws cov lus qhia no los ntawm qib 2 txog 4

www.electronoobs.com/eng_arduino_tut8.php

Txawm li cas los xij peb yuav tsis siv nws tus lej li peb tab tom yuav siv peb tus kheej Thov nco ntsoov tias qee tus neeg hais lus siv ntau zaus sib txawv. Kuv tus neeg hais lus siv 16-ntsis 32kHz audio files. Yog li yog tias koj hais lus ua qee yam suab nrov tab sis tsis ua si koj cov ntaub ntawv ces sim ua si nrog koj zaus.

Kauj ruam 4: Code

Tam sim no peb tab tom yuav upload cov cai rau arduino. Copy tag nrho cov no thiab yav dhau los nws mus rau hauv Arduino IDE thiab xa nws mus rau koj Arduino.

// suav nrog lub tsev qiv ntawv rau SD daim npav nyeem ntawv.#suav nrog "Wtv020sd16p.h" // suav nrog lub tsev qiv ntawv xav tau rau lub sonar sensor. #suav nrog // Teeb tus pin rau Arduino. int resetPin = 4; int clockPin = 5; int dataPin = 6; int busyPin = 7; int soundDetectedPin = 12; int lightDetectedPin = A0; // Teeb tus pin rau lub tsev qiv ntawv SD card. Wtv020sd16p wtv020sd16p (resetPin, clockPin, dataPin, busyPin); // Teeb tus pin rau lub tsev qiv ntawv Sonar sensor. NewPing sonar (11, 10); // Teeb tsa lwm cov tswv yim thiab teeb tsa tus nqi ntawm qhov program. teeb tsa tsis muaj dabtsis () {wtv020sd16p.reset (); pinMode (lightDetectedPin, INPUT); pinMode (soundDetectedPin, INPUT); Serial.begin (9600); } // Qhov tseem ceeb ntawm txoj haujlwm. void loop () {// Poob qhov intergers int lightDetectedVal = analogRead (lightDetectedPin); int nrugVal = sonar.ping_cm (); int soundDetectedVal = digitalRead (soundDetectedPin); // Ncua sij hawm kom qhov project qhov project yuav tsis kawg siv tus hais lus. ncua (30000); // Cov ntawv luam tawm thiab sau kab kom koj tuaj yeem yooj yim pom qhov txiaj ntsig tau coj los ntawm cov qauv ntsuas. Serial.print ("Tus nqi suab:"); // Ntau yam yog cov lus hais kom qhov kev zov me nyuam ua suab sib txawv ntawm cov ntaub ntawv nyob ntawm qhov ntsuas tau ntsuas los ntawm cov ntsuas ntsuas. yog (soundDetectedVal == 0) {Serial.println (soundDetectedVal); Serial.print ("Nyob nrug deb:"); yog (distanceVal == 0) {Serial.println (distanceVal); Serial.print ("Tus nqi pom:"); yog (lightDetectedVal> = 1000) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (1); // Lwm qhov luam tawm kom koj tuaj yeem pom cov ntaub ntawv audio tseeb tau ua si. Serial.println ("1 --------"); // Lwm qhov qeeb kom cia lub suab ua si nws ntev tag nrho. ncua (5000); } lwm yog (lightDetectedVal> = 900) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (2); Serial.println ("2 --------"); ncua (5000); } lwm yog (lightDetectedVal> = 800) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (3); Serial.println ("3 --------"); ncua (5000); } lwm yog (lightDetectedVal> = 700) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (4); Serial.println ("4 --------"); ncua (5000); } lwm yog (lightDetectedVal> = 600) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (5); Serial.println ("5 --------"); ncua (5000); } lwm yog (lightDetectedVal> = 500 || lightDetectedVal 0 || distanceVal == NULL) {Serial.println (distanceVal); Serial.print ("Tus nqi pom:"); yog (lightDetectedVal> = 1000) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (7); Serial.println ("7 --------"); ncua (5000); } lwm yog (lightDetectedVal> = 900) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (8); Serial.println ("8 --------"); ncua (8000); } lwm yog (lightDetectedVal> = 800) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (9); Serial.println ("9 --------"); ncua (5000); } lwm yog (lightDetectedVal> = 700) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (10); Serial.println ("10 -------"); ncua (8000); } lwm yog (lightDetectedVal> = 600) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (11); Serial.println ("11 -------"); ncua (6000); } lwm yog (lightDetectedVal> = 500 || lightDetectedVal <= 1000) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (13); Serial.println ("13 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 900) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (14); Serial.println ("14 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 800) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (15); Serial.println ("15 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 700) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (16); Serial.println ("16 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 600) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (17); Serial.println ("17 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 500 || lightDetectedVal 0 || distanceVal == NULL || distanceVal> = 150) {Serial.println (distanceVal); Serial.print ("Tus nqi pom:"); yog (lightDetectedVal> = 1000) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (19); Serial.println ("19 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 900) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (20); Serial.println ("20 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 800) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (21); Serial.println ("21 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 700) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (22); Serial.println ("22 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 600) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (23); Serial.println ("23 -------"); ncua (5000); } lwm yog (lightDetectedVal> = 500 || lightDetectedVal << 500) {Serial.println (lightDetectedVal); wtv020sd16p.playVoice (24); Serial.println ("24 -------"); ncua (5000); }}}}

Kauj ruam 5: Rooj plaub

Rooj plaub
Rooj plaub
Rooj plaub
Rooj plaub

Tam sim no los txog qhov nyuaj ib feem.

Ua kom haum txhua yam hauv rooj plaub yuav nyuaj me ntsis qhov no nyob ntawm seb koj haum txhua yam rau koj lub khob cij los yog li cas koj muab cov khoom sib dhos ua ke. Tab sis koj yuav tsum tau ua ob peb lub qhov rau cov ntsuas kom lo thorugh. Kuv tso lub micorphone (xav tau 9mm qhov xav tau) thiab cov qauv sonar (6mm qhov xav tau laum) nyob tom qab thiab LDR nyob rau pem hauv ntej ntawm lub tank tab sis koj tuaj yeem tso lawv zoo ib yam yog tias koj muaj qhov chaw.

Nco ntsoov txiav lub qhov hauv lub cev ntawm tus qauv kom tuaj yeem txuas koj lub arduino nrog cov txuas txuas.

Kuv yuav pom zoo tso tus hais lus rau hauv lub turret. raws li yuav tsum muaj chaw seem ntau nyob ntawd.

Sab laug duab saum toj no yog qhov kuv tau teeb tsa lub arduino thiab luam ntawv kuv tau muab tso rau sab hauv Leopard 2 tus qauv. Qhov duab zoo yog ib qho nrog rau feem ntau ntawm cov hlua txuas.

Dab tsi koj tuaj yeem ua yog laum qhov me me hauv qab ntawm tus qauv kom ruaj ntseg Arduino nrog cov hlua txuas.

Tab sis yog tias kuv tsis yuam kev, tam sim no koj yuav tsum ua tiav.

Pom zoo: