Cov txheej txheem:

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

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

Video: Arduino Basic PC With VGA Output: 5 Kauj Ruam (nrog Duab)
Video: Arduino VGA PC running BASIC 2024, Kaum ib hlis
Anonim
Image
Image
Arduino Basic PC Nrog VGA Output
Arduino Basic PC Nrog VGA Output
Arduino Basic PC Nrog VGA Output
Arduino Basic PC Nrog VGA Output

Hauv kuv Cov Lus Qhia yav dhau los Kuv tau qhia yuav tsim lub retro 8-ntsis khoos phis tawj siv lub hauv paus, los ntawm ob Arduino, thiab nrog cov teeb liab tso tawm hauv B&W rau lub TV TV.

Tam sim no kuv yuav qhia yuav tsim tib lub khoos phis tawj li cas, tab sis nrog lub teeb liab tso tawm rau xim rau VGA saib!

Koj tuaj yeem tawm tswv yim hloov pauv thiab BASIC program nrog lub keyboard PS2, thiab nws tsim cov zis rau VGA saib nrog cov lus daws teeb meem ntawm 24 kab x 10 kab ntawm 5x6 pixels cim, hauv plaub xim. 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.

Txoj haujlwm no tseem tuaj yeem siv los luam cov ntawv yooj yim ntawm tus saib, raws li qhia hauv daim duab thib peb hauv nplooj ntawv no.

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 ua rau VGA tso tawm ua tsaug rau VGAx lub tsev qiv ntawv.

Lub tswv yim los siv ib lossis ntau qhov Arduino los tsim lub qub PC style siv cov lus ntawm Basic tsis yog qhov tshiab tab sis, raws li kuv paub, tsis muaj ib tus ntawm lawv muaj cov xim tso tawm. Hauv qee qhov haujlwm muaj nyob hauv net, tib neeg siv cov duab LCD, thaum nyob hauv lwm tus, kom tso cai siv lub saib, nws tau siv TVout library, uas yog B&W. 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 tus tiv thaiv thiab txuas rau PS2 keyboard thiab tus saib, raws li qhia hauv cov duab saum toj no.

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

TinyBasic Plus thiab VGAx lub tsev qiv ntawv ua haujlwm rau Arduino IDE 1.6.4.

Ua ntej rub tawm nws 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_VGAx.ino, uncompress thiab upload nws rau ntawm koj Arduino.

Nov 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 hloov pauv 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 = 4800

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 ntsoov tias kev sib xyaw ua ke no yuav tsis ua haujlwm rau cov keyboard PS2.

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;
  • koj yuav tsum tau txuas nrog GND thiab +5V ib yam nkaus.

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: Rub VGAx Library thiab Code ntawm Arduino Thib Ob thiab Muab Txhua Yam Ua Ke

Rub VGAx Lub Tsev Qiv Ntawv thiab Txoj Cai ntawm Arduino Thib Ob thiab Muab Txhua Yam Ua Ke
Rub VGAx Lub Tsev Qiv Ntawv thiab Txoj Cai ntawm Arduino Thib Ob thiab Muab Txhua Yam Ua Ke

Ua ntej rub tawm VGAx-PC.ino tus lej hauv qab ntawm nplooj ntawv no thiab luam nws ntawm koj lub PC hauv cov npe uas muaj tib lub npe.

Rub tawm VGAx lub tsev qiv ntawv los ntawm qhov txuas ntawm GitHub. Txoj hauv kev yooj yim tshaj plaws yog luam nws hauv Arduino software subfolder lub npe "tsev qiv ntawv", kom tau lees paub tam sim ntawd.

TSEEM CEEB: lub tsev qiv ntawv no ua haujlwm rau Arduno IDE 1.6.4 tab sis nws tsis ua tiav nrog cov laus lossis cov kho tshiab.

Tshaj tawm VGAx-PC.ino hauv koj pawg Arduino thib ob (Kuv tau sim nws rau Nano version tab sis Uno yuav tsum ua haujlwm ib yam nkaus).

Ib qho lus ceeb toom rau lub cim xeeb muaj tsawg yog qhov ib txwm muaj. Yog tias koj tsis muaj lwm qhov yuam kev txhua yam zoo thiab koj tuaj yeem pib tsim koj li 8-ntsis PC.

Rau qhov no koj xav tau:

  • ob Arduino Uno Rev. 3 lossis ob Arduino Nano 3.x (ATmega328)
  • DSUB15 Connector, piv txwv li yog VGA poj niam txuas lossis VGA cable kom raug txiav.
  • resistors: 2 x 68 Ohm thiab 2 x 470 Ohm
  • PS2 poj niam txuas
  • xov hlau
  • facultative: ib lub khob cij los yog lub rooj noj mov

Schematic tau tshaj tawm nyob rau saum toj ntawm cov kauj ruam no. Ib qho piv txwv ntawm qhov ua tiav "console" tau qhia hauv qib pib.

Cov txheej txheem tib yam, nrog rau kev daws teeb meem siab dua, tau tshaj tawm hauv cov ntaub ntawv compressed hauv qab ntawm theem no.

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
Yeem: Siv PCB
Yeem: Siv PCB

Koj tseem tuaj yeem tsim qhov Basic VGA PC siv lub 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 tus kheej lub rooj tsavxwm.

Kuv siv ob tus poj niam header strips nrog 15 qhov rau cov vis dis aus tso tawm Arduino, thaum rau tus tswv Kuv siv ob daim kab xev nrog doble qhov. Hauv txoj kev no kuv tuaj yeem siv sab nraud los ntxig rau cov neeg sib tham ntawm lwm cov phiaj xwm sib luag, uas tuaj yeem tsav ncaj qha nrog Cov lej yooj yim. Kuv kuj tau ntxiv hauv nruab nrab mus rau cov kab uas seem, ib qho txuas rau 5 V thiab lwm qhov rau GND.

Kauj Ruam 5: Cov Lus Kawg thiab Kev lees paub

Kuv qhov kev paub tseem ceeb mus rau Sandro Maffiodo aka Smaffer, tus tsim lub tsev qiv ntawv VGAx txaus.

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: yog tias koj muaj teeb meem, tsis txhob ua siab deb 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: