Cov txheej txheem:

Arduino Basic PC With TV Output: 5 Kauj Ruam (nrog Duab)
Arduino Basic PC With TV Output: 5 Kauj Ruam (nrog Duab)

Video: Arduino Basic PC With TV Output: 5 Kauj Ruam (nrog Duab)

Video: Arduino Basic PC With TV Output: 5 Kauj Ruam (nrog Duab)
Video: NOOBS PLAY CLASH ROYALE FROM START LIVE 2024, Hlis ntuj nqeg
Anonim
Image
Image
Arduino Basic PC Nrog TV Tso Tawm
Arduino Basic PC Nrog TV Tso Tawm
Arduino Basic PC Nrog TV Tso Tawm
Arduino Basic PC Nrog TV Tso Tawm
Arduino Basic PC Nrog TV Tso Tawm
Arduino Basic PC Nrog TV Tso Tawm

Hauv Cov Lus Qhia no kuv yuav qhia yuav tsim lub khoos phis tawj retro 8-ntsis ua haujlwm li cas, los ntawm ob qho Arduino thiab ob peb yam ntxiv.

Koj tuaj yeem tawm tswv yim hloov pauv thiab BASIC program nrog PS2 keyboard, thiab cov txiaj ntsig tau pom ntawm tus saib nrog kab ntawv 47 kab x 29 kab ntawm 8x8 pixels cim (B&W), kev daws teeb meem zoo sib xws lossis zoo dua li Commodore 64, sib npaug rau 40 x 25 po.

Koj tuaj yeem pom nws hauv kev nqis tes ua hauv cov vis dis aus sab saud.

Qhov kev zov me nyuam tuaj yeem raug cawm ntawm Arduino EEPROM, thiab koj tseem tuaj yeem tswj hwm I/O pins ncaj qha los ntawm Cov lus txib tshwj xeeb.

Ib Arduino yog "tus tswv", thiab nws ua haujlwm Tiny Basic Plus, C kev siv Tiny Basic, nrog rau kev tsom mus rau kev txhawb nqa rau Arduino. Nws tseem tswj hwm tus keyboard PS2. Cov txiaj ntsig tau xa tom qab ntawm qhov chaw nres nkoj txuas mus rau Arduino thib ob uas tsim cov vis dis aus ua tsaug rau awsome MRETV lub tsev qiv ntawv.

Lub tswv yim siv ib lossis ntau dua Arduino los tsim lub qub PC style uas siv cov lus ntawm Basic tsis yog qhov tshiab, tab sis txog tam sim no muaj qee qhov kev txwv muaj zog hauv kev daws teeb meem. Hauv qee qhov haujlwm muaj nyob hauv net, tib neeg siv cov duab LCD, thaum nyob hauv lwm tus, kom tso cai siv cov saib, nws tau siv TVout lub tsev qiv ntawv, uas muaj kev daws teeb meem qis dua. Tsis tas li ntawd hauv ntau txoj haujlwm tshwj xeeb cov ntaub thaiv npog lossis kho vajtse yuav tsum tau tsim.

Ntawm no koj xav tau tsuas yog ob qho Arduino, ob peb diodes, ob peb resistors thiab txuas rau PS2 keyboard thiab tus saib, raws li qhia hauv daim duab saum toj no.

Kauj Ruam 1: Tsim Arduino Master Nrog TinyBasic thiab PS2 Keyboard

TinyBasic Plus thiab MRETV ua haujlwm rau cov laus - thiab sib txawv - Arduino IDE.

Thawj rub tawm IDE 1.6.4 los ntawm Arduino lub vev xaib raug cai. Yog tias koj muaj lub khoos phis tawj tshiab hauv koj lub PC, qhov zoo tshaj yog rub nws hauv hom ntawv.zip thiab uncompress lawv ntawm koj lub PC. Nyem qhov txuas no mus rub lub Windows version.

Koj xav tau lub tsev qiv ntawv PS2keyboard. Koj tuaj yeem pom nws hauv qab ntawm nplooj ntawv no. Tsuas yog uncompress nws thiab theej PS2keyboard nplaub tshev hauv: arduino-1.6.4 / tsev qiv ntawv

Thaum kawg, hauv nplooj ntawv no, rub tawm cov ntawv: TinyBasicPlus_PS2.ino, uncompress thiab upload nws rau ntawm koj Arduino.

Qhov no yog qhov hloov pauv ntawm tus qauv TinyBasic Plus qhov twg kuv tau ntxiv PS2 lub tsev qiv ntawv thiab hloov kho cov cai kom lees txais qhov kev lees paub los ntawm nws.

Xav paub ntau ntxiv txog TiniBasic Plus thiab qhia paub tuaj yeem pom ntawm qhov txuas no.

Yog tias tsis muaj teeb meem, thiab teeb meem sib xws, Tiny Basic twb tau ua haujlwm lawm. Koj tuaj yeem sim nws hla tus lej saib hauv koj lub PC. Rau lub hom phiaj no kuv siv PuTTY, tab sis muaj ntau lwm cov haujlwm muaj.

Koj yuav tsum teeb tsa qhov chaw nres nkoj COM raug (nws zoo ib yam koj pom hauv Arduino IDE) thiab tus nqi baud = 2400

Ntawm no koj tuaj yeem sim qee qhov program hauv Basic tsuas yog ntaus lawv nrog koj lub PC keyboard (NB tom qab ntawm qhov kuv yuav qhia yuav ua li cas txuas PS2 keyboard ncaj qha rau Arduino).

Sim ua piv txwv:

10 Luam tawm "Nyob zoo, Ntiaj Teb!"

20 ZOS 10

Khiav

Tom qab ntawd koj tuaj yeem nres lub voj tsis muaj qhov kawg tsuas yog ntaus ctrl+c. Nco tseg tias qhov sib xyaw ua ke no yuav tsis ua haujlwm rau PS2 keyboard.

Hauv theem tom ntej kuv yuav qhia yuav ua li cas txuas PS2 keyboard rau Arduino.

Kauj Ruam 2: Txuas PS2 Keyboard rau Master Arduino

Txuas PS2 Keyboard rau Master Arduino
Txuas PS2 Keyboard rau Master Arduino

Kuv tau txais tag nrho cov ntaub ntawv thiab tsev qiv ntawv los ntawm Cov Lus Qhia no.

Yeej tseem zoo koj yuav tsum txuas nrog plaub tus lej txuas tom ntej:

  • keyboard Cov Ntaub Ntawv rau Arduino tus pin 8,
  • keyboard IRQ (moos) rau Arduino tus pin 3;
  • tau kawg koj yuav tsum txuas nrog GND thiab +5V ib yam.

Kuv tau txais tus qub PS2 poj niam txuas los ntawm lub PC tawg motherboard. Koj tuaj yeem yooj yim muag nws nrog rab phom cua sov.

Hauv daim duab qhia hauv theem no, koj tuaj yeem pom qhov ua haujlwm ntawm tus pin xav tau ntawm PS2 txuas.

Kauj Ruam 3: Upload MRETV Library ntawm Thib Ob Arduino thiab Muab Txhua Yam Ua Ke

Tshaj tawm MRETV Lub Tsev Qiv Ntawv ntawm Arduino Thib Ob thiab Muab Txhua Yam Ua Ke
Tshaj tawm MRETV Lub Tsev Qiv Ntawv ntawm Arduino Thib Ob thiab Muab Txhua Yam Ua Ke

Lub ntsiab lus tseem ceeb ntawm txoj haujlwm no yog qhov muaj txaus ntawm MRETV lub tsev qiv ntawv txaus. Muaj kev qhia tshwj xeeb uas nws tau piav qhia ntxaws.

Nws siv tsuas yog ob tus tiv thaiv thiab ob lub diodes los tsim cov vis dis aus puv npo, nrog cov ntawv daws teeb meem ntawm 47 x 29 ntawm 8x8 cim. Raws li nws hais hauv kev taw qhia, "kev tsim cov vis dis aus tau ua dhau los, tab sis tsis zoo li no. FULL DUPLEX cov ntawv tseem muaj thaum tsim cov vis dis aus". Qhov no tso cai kom tau txais cov ntaub ntawv los ntawm "tus tswv" Arduino thiab qhia lawv ntawm tus saib. Hauv kev xyaum ua qhov thib ob "qhev" Arduino no siv los ua cov duab nraaj!

Txij li MRETV ua haujlwm rau IDE 1.6.6, rub nws los ntawm Arduino lub vev xaib raug cai. Ib zaug ntxiv, qhov zoo tshaj plaws yog rub nws hauv hom ntawv.zip thiab uncompress lawv ntawm koj lub PC. Nyem qhov txuas no mus rub lub Windows version.

Rub tawm lub tsev qiv ntawv MRETV los ntawm qhov txuas no.

Uncompress nws thiab txuag lub nplaub tshev "MRETV" hauv: arduino-1.6.6 / tsev qiv ntawv

Thaum kawg rub tawm TVtext_slave.rar hauv qab ntawm nplooj ntawv no, uncompress nws thiab upload rau hauv koj tus qhev Arduino.

Yog tias tsis muaj lus yuam kev, koj tuaj yeem txuas RCA txuas. Koj xav tau ob lub diodes thiab cov resistors ntawm 1 kOhm thiab 300 Ohm, raws li tau qhia hauv kab lus hauv nplooj ntawv no.

Txij ntawm no koj tuaj yeem txuas txhua yam ua ke.

Daim ntawv teev cov ntaub ntawv tiav yog:

  • ob Arduino Uno Rev. 3 lossis ob Arduino Nano 3.x (ATmega328)
  • ob resistors 1 kOhm
  • ib qho resistor 300 Ohm
  • ob diodes 1n4148 (x2) lossis zoo sib xws silicon hloov diode
  • ob lub RCA ntsaws poj niam (ib qho rau vis dis aus, ib qho ntxiv rau - rau lub suab)
  • PS2 poj niam txuas
  • ib lub khob cij thiab cov xov hlau

Tus tswv Arduino xa cov ntaub ntawv mus rau tus qhev hla lub txiv kab ntxwv, piv txwv li tus tswv pin 1 (Tx) rau tus qhev tus pin 2 (Rx). Yog tias koj xav tau rov tso qee tus lej, koj yuav tsum tshem tawm cov kab no ua ntej.

Txuas txuas tus qhev arduino mus rau 5V lub zog xa khoom, RCA cable rau TV thiab keyboard mus rau PS2, thiab tam sim no koj yuav tsum pom tus lej rau koj lub TV!

Lub luag haujlwm ntawm cov lus yooj yim no tau piav qhia ntxaws hauv nws lub vev xaib (saib txuas hauv kauj ruam 2). Nrog cov lus txib "esave" thiab "eload" koj tuaj yeem txuag tau ib qho program yooj yim hauv EEPROM. Txoj haujlwm no yog ua los ntawm lub hauv paus txhua lub sijhawm koj rov pib dua tus tswv Arduino. Txhawm rau tshem nws koj tuaj yeem siv cov lus txib "eformat".

Ib qho ntawm cov yam ntxwv tseem ceeb tshaj plaws ntawm txoj haujlwm no yog tias koj tseem tuaj yeem tsav tus tswv Arduino I/O nrog rau cov lus txib yooj yim, xws li

  • DWRITE tus pin, tus nqi - teeb tus pin nrog tus nqi (HIGH, HI, LOW, LO)
  • AWRITE tus pin, tus nqi - teeb tus pin nrog tus nqi sib piv (pwm) 0..255
  • DREAD (tus pin) - tau txais tus nqi ntawm tus pin
  • AREAD (analogPin) - tau txais tus nqi ntawm tus pin analog

Yog li koj tuaj yeem sau ib qhov program hauv Basic uas tsav qee yam khoom siv, txuag nws hauv EEPROM thiab tom qab ntawd nws ua haujlwm cia li cia li rov pib dua Arduino.

Kauj Ruam 4: Xaiv tau: Siv PCB

Yeem: Siv PCB
Yeem: Siv PCB
Yeem: Siv PCB
Yeem: Siv PCB
Yeem: Siv PCB
Yeem: Siv PCB

Koj kuj tseem tuaj yeem tsim lub PC yooj yim no siv PCB me me. Koj tuaj yeem siv kev tshoov siab los ntawm cov duab hauv cov kauj ruam no lossis koj tseem tuaj yeem luam koj lub rooj tsavxwm.

Koj tuaj yeem siv ob tus poj niam header strips nrog 15 qhov rau cov vis dis aus tso tawm Arduino, thaum rau tus tswv kuv hais kom siv plaub daim kab xev. Txoj hauv kev no koj tuaj yeem siv sab nraud los ntxig rau cov neeg sib tham ntawm koj qhov project componets.

Kuv kuj tau ntxiv hauv nruab nrab mus rau cov kab uas seem, ib qho txuas rau 5 V thiab lwm qhov rau GND.

Thaum kawg, hauv.rar cov ntaub ntawv, koj tuaj yeem pom lub qhov ncauj qhov ntswg txhawm rau txhawm rau kho lub rooj tsavxwm.

Kauj Ruam 5: Cov Lus Kawg thiab Kev lees paub

Txoj haujlwm no tsis tuaj yeem ua tiav yam tsis muaj MRETV lub tsev qiv ntawv. Yog li kuv qhov kev lees paub tseem ceeb mus rau nws tus sau, uas siv lub npe luv Mr Mr.

Ua tsaug ntau ntau rau tus sau ntawm TinyBasic Plus:

  • Tiny Basic 68k - Gordon Brandly
  • Arduino Basic / Tiny Basic C - Michael Field
  • Me Me Ntxiv Ntxiv - Scott Lawrence

Ua tsaug rau "djsadeepa", tus sau Cov Lus Qhia rau kev txuas ntawm PS2 keyboard.

Rau txhua tus neeg txaus siab rau txoj haujlwm no: nws yooj yim dua los tsim uas nws yuav zoo li thaum pom thawj zaug. Kuv cov teeb meem tseem ceeb tau nrog Arduino IDE sib xws. Yog tias koj muaj teeb meem, tsis txhob yig nug cov lus qhia hauv cov lus.

Yog tias koj ua tiav, thov sau cov lus pom ib yam lossis qhia ib daim duab ntawm lub cuab yeej uas koj tsim.

Pom zoo: