Cov txheej txheem:

Kev Muaj Peev Xwm Muaj Tseeb Nrog Kev Siv Arduino: 7 Kauj Ruam (nrog Duab)
Kev Muaj Peev Xwm Muaj Tseeb Nrog Kev Siv Arduino: 7 Kauj Ruam (nrog Duab)

Video: Kev Muaj Peev Xwm Muaj Tseeb Nrog Kev Siv Arduino: 7 Kauj Ruam (nrog Duab)

Video: Kev Muaj Peev Xwm Muaj Tseeb Nrog Kev Siv Arduino: 7 Kauj Ruam (nrog Duab)
Video: UA KAWG PEEV XWM -May maylee [official] New Song/MV/VDO 2024, Hlis ntuj nqeg
Anonim
Virtual Reality Suit Siv Arduino
Virtual Reality Suit Siv Arduino

Kuv tau tsim txoj haujlwm no los ua si lub khoos phis tawj qub hauv VR. Txoj haujlwm no ua raws koj cov kev txav mus rau hauv nias lossis tuav tus yuam sij ntawm koj cov keyboard

Piv txwv- thaum koj txav mus rau tom ntej qhov kev ua ntawm nias tus yuam sij 'w' yog ua raws.

Kuv tau ua qhov kev ua si Hu rau Lub Luag Haujlwm 4: Kev Ua Rog Niaj Hnub tab sis tsis txhob xaiv cov kev ua si uas tau thim rov qab thaum tua vim tias nws yuav hloov txoj haujlwm tsis raug ntawm nas.

Kauj ruam 1: Yuav tsum tau ua

Yuav tsum yog

Muaj daim ntawv teev npe tag nrho ntawm yam uas koj xav tau los ua daim ntawv no

Kov sensors-5

Lub zog sensor-1

GPU 6050 - 4

(lossis)

GPU 6050 - 2 & Accelerometer - 2

Vr tsom iav

Vr qhib xov tooj

PC

WiFi hotspot

Ib qho khoom ua si phom

Ib lub pc game (kuv tau siv Call of Duty- Modern Warfare 1)

Cov mov ci pawg thawj coj saib (Txiv neej-Poj niam)

ARDUINO LEONARDO-2

Auton Sheild - 2

Lub zog fais fab (lipo)

Zaj sawv xov hlau

Kauj ruam 2: HARDWARE

HARDWARE
HARDWARE
HARDWARE
HARDWARE
HARDWARE
HARDWARE

*reload_pin, shoot_pin, hmo ntuj pom_pin, grenade_pin, riam phom hloov pauv_pin yog kov cov cim. aim_pin yog lub zog ntsuas thiab nas tau ua raws los ntawm MPU6050 lwm qhov ntsuas yog ntsuas lub zog (lub cev, lub zog 1 & 2)

1.1) Kev muag khoom

SOLDER MPU 6050, Accelerometer, Kov Sensor & quab yuam sensor nrog cov xov hlau

1.2) TSHIAB

Rau MPU 6050-

Pin 2- SDA

Pin 3- SCL

GND - NCO

5v - PWR/VCC

Rau kev txav_pin1-

Pin A1- x axis

GND-GND

5v - PWR/VCC

Rau kev txav_pin2-

Pin A2- x axis

GND-GND

5v - PWR/VCC

Rau posture_pin-

Pin A0- x axis

GND-GND

5v - PWR/VCC

rau weapon_pin -

sib -5v

GND-GND

5v - PWR/VCC

Rau Reload_pin -

pin 12 - 5 v

GND-GND

5v - PWR/VCC

Rau Nightvision_pin -

pin 10 - 5 v

GND-GND

5v - PWR/VCC

Rau shoot_pin -

Pin 7 - 5 v

GND-GND

5v - PWR/VCC

Rau aim_pin -

Pin 8 - 5 v

5v - PWR/VCC

1.3) SIV QHOV CHAW

Siv cov kab hluav taws xob txuas nrog cov zaj sawv

1.4) RAWS LI

Xev cov xov hlau nrog daim kab xev rwb thaiv tsev ntawm qhov chaw uas koj tau xaws kom tsis txhob muaj kab hluav taws xob luv

Kauj ruam 3: SOFTWARE

SOFTWARE
SOFTWARE
SOFTWARE
SOFTWARE

Kuv tau siv daim ntawv thov hu ua 'Remotr' los ntawm Play store los pov cov vis dis aus los ntawm lub khoos phis tawj mus rau lub xov tooj

2.1) REMOTR-

Nruab REMOTR daim ntawv thov rau koj lub khoos phis tawj thiab tsim ib tus as khauj

Nov yog qhov txuas-

remotrapp.com/#download

Nruab REMOTR app hauv koj lub smartphone

2.2) VIDEO TSHIAB

Ua ntej txuas ob lub khoos phis tawj thiab tib lub network WiFi thiab nkag mus rau koj tus lej REMOTR hauv ob qho khoom siv

tam sim no tus kheej ntxiv qhov kev ua si uas koj xav kom kwj hauv software

tam sim no lub app yuav qhia lub khoos phis tawj raws li admin nyem rau nws kom pib tso tawm

Txhawm rau kwj hauv VR pab vr hom hauv koj lub xov tooj

Yog tias koj tsis nkag siab Txheeb xyuas qhov txuas no rau cov ncauj lus ntxaws

remotrapp.com/en/howto

Kauj ruam 4: MAIN CODE

Txoj cai rau txoj haujlwm no tsis nyuaj lossis nyuaj tab sis ntev

Nov yog cov cai tsuas yog luam nws thiab muab tso rau hauv koj cov ntaub ntawv arduino

ARDUINO

LEONARDO Mus-

Kuv tau teb Gabry295. Tus lej nas no yog ua raws nws lub taub hau Mouse qhia tau

#suav nrog

#suav nrog

#suav nrog

#suav nrog

koj aim_pin;

int tua_pin;

MPU6050 mpu;

int16_t ax, ay, az, gx, gy, gz;

koj vx, vy;

void teeb tsa () {

Serial.begin (9600);

Nas.begin ();

Hlau.begin ();

mpu.initialize ();

yog (! mpu.testConnection ()) {

thaum (1);

}

pinMode (7, INPUT);

pinMode (8, INPUT);

}

void voj () {

shoot_pin = digitalRead (7);

aim_pin = digitalRead (8);

mpu.getMotion6 (& ax, & ay, & az, & gx, & gy, & gz);

vx = (gx-300)/200; // Kuv tau muab -300 thiab +490 raws li kuv tus mpu6050 qhia cov txiaj ntsig no thaum tsis txav mus

vy = -(gz+490)/200; // txheeb xyuas tus lej ntawm lub taub hau nas los ntawm Gabry295 kom paub meej ntxiv txog cov txiaj ntsig no

Mouse.move (vx, vy);

ncua (20);

thaum (shoot_pin == HIGH);

{

Nas.click ();

}

thaum (aim_pin == HIGH);

{

Nas.click ();

}

}

Keyboard ntawm Leonardo

#suav nrog

koj Grenade;

int riam phom_pin;

koj reload_pin;

int zog1_pin;

int zog2_pin;

int posture_pin;

char nightvision_pin;

void teeb tsa ()

{

pinMode (7, INPUT);

pinMode (8, INPUT);

pinMode (9, INPUT);

pinMode (10, INPUT);

pinMode (11, INPUT);

pinMode (12, INPUT);

pinMode (A0, INPUT);

pinMode (A1, INPUT);

Keyboard.begin ();

}

void lub voj ()

{

Grenade_pin = digitalRead (8);

weapon_pin = digitalRead (9);

movement1_pin = analogRead (A1);

txav2_pin = analogRead (A2);

posture_pin = analogRead (A0);

reload_pin = digitalRead (12);

nightvision_pin = digitalRead (10);

yog (grenade == HIGH)

{

Keyboard.press ('g');

}

thaum (riam phom_pin == HIGH)

{

Keyboard.press ('q');

}

thaum (reload_pin == HIGH)

{

Keyboard.press ('r');

}

thaum (txav 1_pin> 340 && txav1_pin <420)

{

Keyboard.press ('w');

}

thaum (txav1_pin> 420)

{

Keyboard.press ('w');

Keyboard.press ('p');

}

thaum (txav2_pin> 340 && txav2_pin <420)

{

Keyboard.press ('w');

}

thaum (txav2_pin> 420)

{

Keyboard.press ('p');

Keyboard.press ('w');

}

thaum (posture_pin> 340 && posture_pin <420)

{

Keyboard.press ('c');

}

thaum (posture_pin> 420)

{

Keyboard.press ('l');

}

thaum (posture_pin <340)

{

Keyboard.press ('z');

}

thaum (nightvision_pin == HIGH)

{

Keyboard.press ('n');

}

}

}

Kauj ruam 5: TEST CODES

Nov yog ob peb cov lej faib los ntawm cov cai tseem ceeb raws li kev ua haujlwm

Tua

#suav nrog

tus x;

void teeb tsa () {

pinMode (8, INPUT);

Nas.begin ();

}

void voj () {

x = digitalRead (8);

yog tias (x == HIGH)

{

Mus.click ('g');

}

}

AIMING-

#suav nrog

#suav nrog

#suav nrog

#suav nrog

MPU6050 mpu;

int16_t ax, ay, az, gx, gy, gz;

koj vx, vy;

void teeb tsa () {

Serial.begin (9600);

Nas.begin ();

Hlau.begin ();

mpu.initialize ();

yog (! mpu.testConnection ()) {

thaum (1);

}

}

void voj () {

shoot_pin = digitalRead (7);

aim_pin = digitalRead (8);

mpu.getMotion6 (& ax, & ay, & az, & gx, & gy, & gz);

vx = (gx+300)/200; // "+300" vim tias x axis ntawm gyroscope muab qhov ntsuas txog -350 thaum nws tsis txav mus. Hloov tus nqi no yog tias koj tau txais qee yam sib txawv siv TEST code, ua raws yog tias muaj qhov txiaj ntsig deb ntawm xoom.

vy = -(gz_ -100)/200; // tib yam ntawm no txog "-100"

NCO NTSOOV-

#suav nrog

tus x;

void teeb tsa () {

pinMode (8, INPUT);

Keyboard.begin ();

}

void voj () {

x = digitalRead (8);

yog tias (x == HIGH)

{

Keyboard.press ('r');

}

lwm tus

{

Keyboard.release ('r');

}

}

NOV VISIO #suav nrog

tus x;

void teeb tsa () {

pinMode (8, INPUT);

Keyboard.begin ();

}

void voj () {

x = digitalRead (8);

yog tias (x == HIGH)

{

Keyboard.press ('g');

}

lwm tus

{

Keyboard.release ('g');

}

}

KOOB THIAB PRONE-

#suav nrog

tus y;

void teeb tsa () {

pinMode (A0, INPUT);

Serial.begin (9600);

}

void voj () {

y = analogRead (A0);

yog tias (y <260)

{

Keyboard.release ('c');

Keyboard.release ('p');

}

lwm yog (y> 260 && y <310)

{

Keyboard.press ('c');

}

lwm yog (y> 310)

{

Keyboard.press ('p');

}

}

Kauj Ruam 6: QHOV TSEEM CEEB

hloov cov kev ua si raws li hauv qab no

cog - x

loj - l

kev hloov riam phom - q

sprint - ib

sawv/dhia - z

hmo ntuj pom kev - n

kev txav mus los - w

foob pob - g

Kauj Ruam 7: Teeb tsa

Teem caij
Teem caij
Teem caij
Teem caij
Teem caij
Teem caij

Thaum kawg peb tau los txog qib kawg tam sim no tso cov arduino

cov laug cam nyob rau hauv ib lub thawv thiab plam nws mus rau hauv lub hnab

Tam sim no txuas lub micro USB ntawm arduino mus rau USB chaw nres nkoj ntawm lub laptop tam sim no txuas lub ntsuas cua raws li tau hais los saum toj no

*xub cim hauv cov duab saum toj no qhia txog kev taw qhia uas lub sensor yuav tsum fim

Yog tias koj muaj kev ua xyem xyav tsis txhob ua siab deb tawm lus thiab tsis txhob hnov qab qhia koj cov kev paub

Nws yog ua tsaug koj thiab

BYE.

Pom zoo: