Cov txheej txheem:

Settlers of Raspi - Settlers of Catan Clone Nrog Electronics: 5 Kauj Ruam
Settlers of Raspi - Settlers of Catan Clone Nrog Electronics: 5 Kauj Ruam

Video: Settlers of Raspi - Settlers of Catan Clone Nrog Electronics: 5 Kauj Ruam

Video: Settlers of Raspi - Settlers of Catan Clone Nrog Electronics: 5 Kauj Ruam
Video: Catan vs The Settlers of Catan Component Review 2024, Kaum ib hlis
Anonim
Settlers ntawm Raspi - Settlers ntawm Catan Clone Nrog Electronics
Settlers ntawm Raspi - Settlers ntawm Catan Clone Nrog Electronics

Cov lus qhia no yuav coj koj mus dhau cov kauj ruam ntawm kev tsim "Settlers of Raspi", Settlers of Catan game nrog cov khoom siv hluav taws xob thiab lub web interface.

Khoom siv

Hauv qab no yog cov khoom siv uas koj xav tau hauv orde kom ua raws phau ntawv qhia no.

Nco ntsoov tias qee cov kauj ruam tuaj yeem ua tiav sib txawv, zoo li siv lub khob cij tsis txhob siv qee qhov chaw.

Qhov no tsuas yog qhia koj txog cov txheej txheem thiab cov khoom siv uas kuv tau siv hauv kuv qhov kev tsim, xav tias yuav hloov pauv yam koj xav tau.

Kho vajtse

  • Raspberry PI 3 B+
  • Arduino UAS
  • MCP23017 (x9)
  • Khawm (x 144)
  • 10k resistors (tsuas yog qee qhov)
  • 220 resistors (x144)
  • 330 resistors (x19)
  • 2 x 16 LCD
  • MFRC522 RFID-Nyeem Ntawv
  • LDR
  • Dawb Leds (x19)
  • RGB Ledstrip (nquag cathode)
  • 16-channel CD74HC4067
  • Bi-directional Qib-hloov pauv
  • 4 daim phiaj ntawm multiplex 8mm x 524mm x 454mm
  • Ntau cov kab
  • Tooj phaj

Kauj Ruam 1: Ua Case

Ua Case
Ua Case
Ua Case
Ua Case

Ua rooj plaub rau txoj haujlwm no yog peb thawj lub hom phiaj, qhov no yuav ua rau txhim kho kho vajtse yooj yim dua.

Lasercutting

Rub tawm 4 suav nrog. AI cov ntaub ntawv thiab coj lawv mus rau koj lub laser txiav-ze-khw nrog rau koj cov paib ntau tshaj.

Thiab tom qab ntawd lasercut cov phiaj nrog cov ntaub ntawv muab; p

Khaws txhua qhov uas raug txiav tawm, koj yuav xav tau lawv.

Muab tso ua ke

Rau lub rooj sib txoos, lo cov phaj raws li hauv qab no: Catan_Base> Catan_Base_Holed> Catan_Border_Tiles_Bottom> Catan_Border_Tiles_Top

Tos nrog ntxiv rooj plaub rau cov khoom siv hluav taws xob, raws li koj yuav xav tau qee qhov chaw ua haujlwm nrog ua ntej.

Cov vuas

Hmoov tsis zoo, ntu no tseem tsis tau tiav thiab yuav muab kho dua ib zaug

Cov vuas rau qhov kev ua si kuj tau txais los ntawm cov ntaub ntawv lasercutting (yeej-yeej txoj cai, vim qhov no tiv thaiv cov ntaub ntawv pov tseg).

Daim duab saum toj no qhia sab saum toj (sab laug) thiab hauv qab (sab xis) ib feem ntawm cov vuas.

Hauv 1 sab ntawm cov vuas, hollow tawm qee cov ntoo, yog li koj muaj qee qhov chaw tso khoom siv hluav taws xob.

Rau txhua ntawm cov vuas koj xav tau: 1 10k resistor, 1 resistor nyob rau hauv thaj tsam ntawm 18k txog 47k (txhua hom pobzeb xav tau qhov sib txawv resistor, 6 hom hla qhov no) thiab 1 dawb LED.

Tam sim no muab cov khoom siv hluav taws xob tso rau hauv (saib ntawm daim duab saum toj no).

Tsoo qhov kawg ntawm cov xov hluav taws xob hla lub qhov me me rau hauv qab-pobzeb (tsuas yog qhov qhov teeb meem yog: Qhov chaw nyob nruab nrab: anode ntawm LED, qhov ze rau qhov chaw nruab nrab qhov: cathode ntawm cov coj).

Tam sim no, txiav koj cov phaj tooj liab rau hauv daim me me 5x5mm, thiab muab lawv txuas rau cov hlua txuas tawm ntawm lub qhov nyob sab nrauv ntawm cov pobzeb hauv qab.

Kauj Ruam 2: Cov Khoom Siv Hluav Taws Xob

Wow, koj twb tau ua tiav qhov no lawm?

Cia peb ua nws nrog tom qab;)

Nqe lus no yooj yim piav qhia, tsuas yog ua raws cov txheej txheem suav nrog ntawm no.

Kauj Ruam 3: Teeb Kho Raspberry PI

Woohoo, tam sim no mus rau qhov lom zem! Teeb tsa raspberry pi: D

Txhim kho raspberry pi

Tsim cov duab

Ua ntej tshaj, koj yuav tsum rub ob qho ntawm cov ntawv txuas.

  • Win32 Disk Imager
  • Raspian OS

Tam sim no ua raws cov theem no:

  1. Ntxig koj daim npav micro-SD rau hauv koj lub computer
  2. Qhib Win32 Disk Imager
  3. Xaiv cov ntaub ntawv.img koj nyuam qhuav rub tawm
  4. Nyem 'sau'

Txhawm rau nkag mus rau pi, peb yuav xav tau ob peb kauj ruam ntxiv

  1. Mus rau SD-card's boot directory
  2. Tsim cov ntawv sau hu ua "ssh.txt"
  3. Rho tawm.txt ncua ntxiv
  4. Qhib cov ntaub ntawv "cmdline.txt"
  5. Thaum kawg ntawm cov ntawv, ntxiv ip = 169.254.10.1 (tab sis khaws qhov no ntawm kab tib yam li txhua lwm cov ntawv.

Teeb tsa pi

Txuas 1 kawg ntawm tus ethernet cable hauv koj lub pc thiab lwm qhov kawg hauv koj tus pi.

Tam sim no lub zog pi, tos 5 feeb kom ntseeg tau tias pi tau pib raug.

Qhib koj tus neeg siv SSH uas kuv nyiam (Kuv siv Putty) thiab txuas rau IP uas peb muab rau pi hauv cov theem saum toj no.

Default username thiab password yog "pi" thiab "raspberry".

Hauv raspi-teeb tsa, pab kom I2C.

Tau txais pi ntawm wifi

Txhawm rau kom tau txais koj cov raspberry pi ntawm koj lub wifi, ntaus hauv qab cov lus txib:

sudo -iwpa_passphrase "mySSID" "myPASSWORD" >> /etc/wpa_supplicant/wpa_supplicant.conf wpa_cli interface wlan0 reconfigure

Tsis txhob hnov qab hloov "mySSID" thiab "myPASSWORD" nrog SSID thiab PASSWORD ntawm koj lub router.

Rub tawm pob thiab sau ntawv

Peb yuav tsum tau teeb tsa qee pob khoom thiab cov ntawv sau txhawm rau kom ua tiav txoj haujlwm no thiab ua haujlwm tau zoo, yog li thov sau cov lus txib hauv qab no:

sudo apt nruab mariadb-server

sudo apt install apache2 -y pip install Flask Flask-Cors Flask-MySQL Flask-SocketIO PyMySQL

Teeb lub Database

Txhawm rau kom peb siv txoj haujlwm kom nws muaj peev xwm tag nrho, peb yuav xav tau los teeb tsa peb cov database! Yog li cia peb ua qhov quav!

mysql_secure_installation

Thaum nws nug txog peb tus password, tsuas yog nias nkag, raws li peb tseem tsis tau tsim ib tus neeg siv.

Tom ntej no nws yuav nug peb yog tias peb xav tau tus lej zais hauv paus, xaiv yog, thiab nkag mus rau tus password uas xav tau.

Xaiv yog rau tag nrho cov lus nug ntxiv.

sudo -i ua

mysql pab txhua qhov priveleges ntawm rpiUser.* rau ''@'%' txheeb xyuas los ntawm ''; FLUSH PRIVELEGES

nco ntsoov tias koj tsim tus neeg siv hu ua rpiUser nrog tus password omgThisIsSoSecret

Kauj ruam 4: Rub tawm daim ntawv thov nws tus kheej

Peb nyob ze, tsuas yog dai nrog kuv me ntsis ntxiv!

Ua raws qee cov lus txib (ib zaug ntxiv):

cd /home /pib

git clone https://github.com/StevenCopermans/Settlers-of-Ra … SettlersOfRaspicd SettlersOfRaspi sudo cp -R Website//var/www/html/sudo cp -R SettlersOfRaspi//home/pi/SettlersOfRaspi sudo mysql -u hauv paus -p << DATABASE.sql sudo nano /etc/rc.local

Qhov kawg ntawm cov ntawv uas nyuam qhuav qhib, ua ntej tawm, ntxiv kab hauv qab no:

python3 /home/pi/SettlersOfRaspi/app.py $

Tom qab ntawd nias ctrl + X> y> nkag

Kauj ruam 5: Arduino

Kauj ruam kawg! Wooo

Rub tawm daim ntawv Arduino

Qhib cov ntawv tais ceev tseg hauv qhov program arduino, thiab xa cov ntawv!

Qhov ntawd yog nws! Peb ua tiav!

Txaus siab rau qhov kev ua si!: D

Pom zoo: