Cov txheej txheem:

Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore: 4 Kauj Ruam (nrog Duab)
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore: 4 Kauj Ruam (nrog Duab)

Video: Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore: 4 Kauj Ruam (nrog Duab)

Video: Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore: 4 Kauj Ruam (nrog Duab)
Video: Skyward Sword [Part 3] | BECOMING A LEGEND 2024, Hlis ntuj nqeg
Anonim
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore
Ib Lub Suab-Tswj, Braille-Type Pattern Semaphore

"Tus Tswv Vetinari sawv ntawm nws lub qhov rais saib lub tsev pheeb suab nyob ib sab ntawm tus dej. Txhua yim ntawm lub qhov rooj loj uas ntsib nws tau ntsais muag npau taws heev - dub, dawb, dub, dawb, dub, dawb … Cov ntaub ntawv tau ya mus rau saum huab cua. Nees nkaum mais tom qab nws, ntawm lwm tus pej thuam ntawm Sto Lat, ib tug neeg tau saib los ntawm lub tsom iav tsom iav thiab qw tus lej. Yuav ua li cas sai sai yav tom ntej los rau peb, nws xav. " T. Pratchett, Tus Ntxhw Fifth

Tom qab tsim lub suab tswj-dhia dhia raws li AIY lub suab khoom, Kuv tau muaj lub tswv yim los tsim lub suab tswj lub semaphore, ua ke ua qhov tseeb hauv IT thev naus laus zis nrog kev pib ntawm kev sib txuas lus thiab xa cov ntaub ntawv.

Thaum xub thawj kuv tau muaj lub tswv yim los hloov pauv Fab Kis semaphore system los ntawm Chappe, uas yog thawj qhov kev paub rau kev sib tham hauv xov tooj cua thoob tebchaws uas siv lub semaphore system. Tab sis nws tau dhau los ua qhov nyuaj me ntsis kom pom tau tias siv tus qauv servos hauv ib hnub. Kuv lub hom phiaj tom ntej yog qee yam zoo sib xws rau cov kab ke sib tham piav los ntawm Terry Pratchett, xws li hauv "Mus Tom Tsev", raws li 2x4 shutter semaphore system (tsis zoo li 4x4 matrix piav qhia hauv yeeb yaj kiab). Hmoov tsis zoo kuv tsis tuaj yeem pom ntau cov ntsiab lus qhia muaj nyob hauv cov kab ke no. Yog li kuv tau xaus nrog 2x3 matrix semaphore system tsim los ntawm Lord Murray, uas tau siv los ntawm British Navy ib pliag. Ib qho ntxiv, rau rau qhov kaw qhov/me ntsis ua haujlwm tau zoo rau rau rau rau servo txuas txuas muaj nyob ntawm AIY lub suab HAT. Tab sis, raws li kuv tsis muaj rau tus neeg ua haujlwm ntawm tes ntawm lub xyoo, thaum kawg kuv txiav txim siab los tsim lub tshuab ua los ntawm LEDs ua ntej.

Hais txog cov cai tso tawm, ib tus tuaj yeem siv Murray system, tab sis rov hais dua cov ntaub ntawv kuv tau muaj ntawm nws yog qhov txwv, tsis pub tso tawm ib qho lej thiab cim. Yog li kuv los txog rau qhov siv Braille system hloov pauv, uas tseem siv 2x3 lub zeem muag los tso saib cov tsiaj ntawv, tus lej thiab lwm yam cim. Cov txheej txheem Braille yog tus txheej txheem thoob ntiaj teb los luam cov ntawv nyeem tau rau cov dig muag. Nws kuj yog hom lus cim, uas siv tus lej ntsuas los txheeb xyuas tus lej yuav raug nthuav tawm tom ntej, thiab ntsuas ntsuas los txheeb xyuas qhov ntawd, lossis ntau, ntawm cov ntawv hauv qab no tau sau ua cov ntawv. Yog li kuv thiaj txiav txim siab teeb tsa qhov txheej txheem yooj yim me ntsis, nrog cov lej thiab qee cov cim qhia los ntawm Nemeth txuas ntxiv ntawm Braille system hloov, thiab tsuas yog siv cov ntawv loj, tsawg kawg rau qhov pib. Qhov no tso cai kom muaj cov qauv tshwj xeeb rau txhua tsab ntawv, tus lej lossis kos npe kom pom nyob rau hauv kuv daim ntawv thov tshwj xeeb, thiab tshem tawm cov ntawv tshuaj xyuas uas xav tau rau Braille tiag.

Cov cuab yeej kawg tso cai hais lus lossis kab lus rau hauv AIY lub suab lees paub lub kaw lus, tom qab ntawd lub suab qauv cov ntaub ntawv raug xa ntawm WLAN thiab internet mus rau qee qhov Google sever hauv Asmeskas, tau txiav txim siab nyob ntawd, thiab, tsawg kawg hauv kuv qhov xwm txheej, txhais lus cov ntaub ntawv raug xa rov qab mus rau Tebchaws Europe, qhov kawg thaum kawg kuv tau txais kab lus lees paub pom ua kab ntawv. Cov kab ntawv no tau tawg los ntawm Python tsab ntawv rau hauv cov ntawv ib leeg, thiab tam sim no, los ntawm kev sib piv nrog phau ntawv txhais lus piav qhia tus qauv sib xws, cov ntaub ntawv xov xwm tau rov qab los thiab cov qauv tau tshwm ntawm 2x3 LED matrix. Thov ua tib zoo saib ntawm daim vis dis aus nrog.

Kuv tau teeb tsa cov duab tso rau ib tus cim ib ob, uas yuav tsum ntev txaus rau tus neeg tau kawm los txheeb xyuas thiab txhais tus qauv. Cov kauj ruam tom ntej uas yuav ua tau yog siv tus qauv paub zoo ib yam li AIY lub zeem muag HAT (kom deb li deb tsis muaj nyob hauv Europe) los nyeem thiab txhais cov qauv siv tau, yog li kaw lub voj voog.

Cov tswv yim ntxiv rau kev txhim kho, qee qhov nrog qhov tseeb hauv ntiaj teb, tau tham hauv 'qhov kev cia siab' ib feem ntawm cov lus qhia no.

Kauj Ruam 1: Cov Khoom Siv

Cov Khoom Siv
Cov Khoom Siv
Cov Khoom Siv
Cov Khoom Siv

Raspberry Pi 3

AIY lub suab HAT

Yim LEDs dawb, 5 hli txoj kab uas hla. Cov no khiav ntawm 3V, yog li xav tau tus tiv thaiv.

100 kOhm Resistor. Tej zaum tsis yog cov tshuaj zoo tshaj plaws, tab sis nyob ntawm tes.

Jumper cables

Ib daim luv ntawm xaim

Breadboard, xaiv tau los ntsuas qhov teeb tsa.

Lub thawv yas rau daim npav ua lag luam.

Ob daim ntawm 4 hli yas ua npuas dej, qee qhov tshuav ntawm cov khib nyiab.

Qee daim yas yas, zoo li diffuser, zoo li saum toj no.

Soldering hlau thiab solder, riam.

Kauj ruam 2: Teeb thiab Siv

Teeb thiab Siv
Teeb thiab Siv
Teeb thiab Siv
Teeb thiab Siv
Teeb thiab Siv
Teeb thiab Siv

Teeb Raspberry Pi thiab AIY HAT raws li qhia hauv AIY lub suab HAT phau ntawv. Kuv xav pom zoo kom txuas lub taub hau tsawg kawg rau qhov chaw nres nkoj servo ua ntej koj sib sau ua ke Pi thiab HAT, vim qhov no tso cai rau koj yooj yim txuas servos, lub khob cij lossis LEDs.

Lub thawv ntawv tau tsim los ntawm lub hau ntawm lub thawv yas rau daim npav ua lag luam, ob daim ua npuas dej haum rau hauv lub thawv thiab qhov zoo ib yam ntawm daim ntim ntim raws li diffuser. Hauv ib qho ntawm qhov ua npuas dej rau rau qhov raug thawb thiab LEDs tso rau hauv lawv. Cov taw luv (sab hauv av) ntawm LEDs tau txuas nrog txhua lwm tus los ntawm ib daim kab xev, tom qab ntawd tau ntxiv tus tiv thaiv thiab txuas cov hlua txuas txuas rau tom kawg. Mus rau lwm tus taw (ntxiv rau sab) ntawm LEDs jumper cables tau muab muag.

Cov no tau txuas nrog cov chaw nres nkoj servo ntawm AIY lub suab HAT ntawm cov xov txuas txuas, qhov zoo rau (sab nraud) "P hauv" pins, qhov txuas tsis zoo rau ib qho ntawm (sab hauv) hauv av/rho tawm tus pin. Thov saib ntawm cov phiaj xwm txuas nrog.

Kuv xav pom zoo kom sim teeb tsa ntawm lub khob cij ua ntej yuav siv tas.

Tam sim no daim nyias nyias, LED phaj thiab txheej txheej tau muab tso rau hauv lub thawv yas.

Muab Braille_LED_1.py tsab ntawv rau hauv src nplaub tshev. Hauv qhov xwm txheej, koj yuav tsum tau ua tsab ntawv ua tiav ua ntej.

Tam sim no siv Dev davhlau ya nyob twg (!) Braille_LED_1.py program tau pib. Sau 'src/Braille_LED_1.py' thiab nias 'Enter'.

Tam sim no koj yuav raug hais kom nyem lub pob ntawm AIY lub thawv thiab hais koj lo lus lossis kab lus. Nrog qee qhov kev ncua, lub kaw lus yuav rov ua dua qhov uas tau nkag siab, thiab tso nws tawm ntawm lub vijtsam ntxiv rau, tsab ntawv los ntawm tsab ntawv, ntawm rau rau tus lej LED.

Yog tias koj muab lo lus tseem ceeb "Goodbye" tsis txhob siv kab lus, lub kaw lus yuav qhia koj tias nyob zoo, thiab txoj haujlwm yuav raug kaw.

Kauj Ruam 3: Txoj Cai

Txoj Cai
Txoj Cai

Hauv qab no koj pom cov cai uas tso cai rau koj tham nrog AIY lub suab ntaus ntawv thiab muaj cov kab lus lees paub pom los ntawm tsab ntawv ntawm tus me me 2x3-LED 'semaphore' lossis Braille-type matrix.

Cov cai yog qhov muab los ntawm tsab ntawv kuv tau siv rau txoj haujlwm yav dhau los siv AIY lub suab HAT, yog qhov ua piv txwv ntawm servo_demo.py piv txwv tau piav qhia hauv AIY lub suab HAT phau ntawv.

Koj tseem tuaj yeem pom phau ntawv txhais lus nrog rau ib feem ntawm Murray code kuv tau pom hauv internet, raws li cov ntawv sau. Nws tsis muaj tus lej thiab tsis suav qee tus tsiaj ntawv, uas yuav muab teeb meem ntawm no.

Ib qhov txwv ntawm txoj haujlwm hauv nws lub xeev tam sim no yog tias yog lub cim tsis suav nrog hauv phau ntawv txhais lus nws yuav ua rau txoj haujlwm poob. Ib qho ntxiv nws tsis yog sawv cev ntawm qhov ua tiav Braille Code ua lus Markup. Raws li koj tuaj yeem pom hauv tsab ntawv hauv qab no, Nemeth code rau cov lej yog rov ua dua nrog qee cov cim hauv tus qauv Braille, tab sis qhov ntawd yuav tsum tsis txhob muab teeb meem rau peb cov ntawv thov tshwj xeeb.

#!/usr/bin/env python3

# Tsab ntawv no yog kev hloov kho ntawm tsab ntawv servo_demo.py rau AIY lub suab HAT, # ua kom zoo rau AIY raws li Baille hom cim cim ntshuam aiy.audio ntshuam aiy.cloudspeech ntshuam aiy.voicehat los ntawm gpiozero ntshuam LED #from gpiozero ntshuam khawm los ntawm lub sij hawm ntshuam pw # Phau ntawv txhais lus: hloov kho cov ntawv Braille, # tus lej thiab qee lub cim coj los ntawm Nemeth txuas ntxiv ntawm Braille Braille_6A = {"": "123456", # chaw "A": "1", "B": "12 "," C ":" 14 "," D ":" 145 "," E ":" 15 "," F ":" 124 "," G ":" 1245 "," H ":" 125 ", "Kuv": "24", "J": "245", "K": "13", "L": "123", "M": "134", "N": "1345", "O" ":" 135 "," P ":" 1234 "," Q ":" 12345 "," R ":" 1235 "," S ":" 234 "," T ":" 2345 "," U ": "136", "V": "1236", "X": "1346", "Y": "13456", "Z": "1356", "W": "2456", "#": "3456 ", # Tus lej ua ntej, piv txwv li cov cim tom ntej yog tus lej", ":" 2 ",". ": "256", # Tag nrho nres, xaus kab lus (GB) "?": "236", "yog"!: "235", "" ":" 3 ","-":" 24 ","; ": "23", "Cap": "6", # Tsab ntawv tom ntej yog nyob hauv Capitals; Naj Npawb-Nres? "": "", # Nemeth Braille code yog kev ua lej rau 6-Point Braille # saib: https://en.wikipedia.org/wiki/Nemeth_Braille "1": "2", # Nemeth Code '1', Braille 'comma' "2": "23", "3": "25", "4": "256", "5": "26", "6": "235", # Nemeth '6', Braille '!' "7": "2356", "8": "236", # Nemeth '8', Braille '?' "9": "35", "0": "356", "+": "346", "-": "36", "/": "34", "(": "12356", ") ":" 23456 ","*":" 1346 " # '*' yog ob lub cim cim nyob hauv Nemeth, ntawm no hloov los ntawm 'x' kom tshem tawm kev sib tsoo}" "" rau qhov laj thawj yooj yim, tus lej Braille tus qauv qauv muab hauv qab no tau hloov pauv los ntawm kev hloov pauv Nemeth-Codes "1": "1", "2": "12", "3": "14", "4": "145", "5": "15", " 6 ":" 124 "," 8 ":" 1245 "," 9 ":" 24 "," 0 ":" 245 "," "" #Text = "rbhTZkl 9t64+34 #!" # Sampletext, rau kev debug lub hom phiaj def lub ntsiab (): lees paub = aiy.cloudspeech.get_recognizer () lees paub.expect_phrase ('goodbye') # lo lus tseem ceeb, xaus lub program khawm = aiy.voicehat.get_button () # AIY khawm xwm txheej coj = aiy.voicehat.get_led () # AIY Khawm-LED xwm txheej aiy.audio.get_recorder (). pib () led_1 = LED (26) # 1st txuas, servo0, GPIO 26 # sab laug sab laug led_2 = LED (6) # 2nd txuas, servo1, GPIO 06 # nruab nrab sab laug led_3 = LED (13) # thib txuas, servo2, GPIO 13 # qis dua led_4 = LED (5) # 4st txuas, servo3, GPIO 05 # sab xis coj_5 = LED (12) # 5 txuas, servo4, GPIO 12 # nruab nrab txoj cai led_6 = LED (24) # 4st txuas, servo3, GPIO 13 # qis sab xis # nrug = Khawm (5) # nrug sensor txuas nrog servo3/GPIO 05, tsis siv ntawm no aiy.audio.say ("Nyob zoo!",) Aiy.audio.say ("Txhawm rau pib, thov nias lub pob",) aiy.audio.say ("Yog tias koj qhia kuv zoo, Kuv yuav xaus qhov haujlwm",) thaum Muaj tseeb: # pib loop coj.set_state (aiy.voicehat. LED. BLINK) luam tawm ("Txhawm rau qhib lub suab lees paub n, nias lub pob xiav, tom qab ntawd hais lus ") luam tawm () button.wait_for_press () luam tawm ('Mloog …') aiy.audio.say (" Kuv mloog ",) led.set_state (aiy.voicehat. LED. BLINK_3) text = recognizer.recognize () # kab ntawv ntawm cov kab lus lees paub led.set_state (aiy.voicehat. LED. OFF) yog cov ntawv tsis muaj: aiy.audio.say ('Thov txim, kuv tsis hnov koj.',) elif 'nyob zoo' hauv cov ntawv: aiy.audio.say ("Goodbye",) aiy.audio.say ('Arrivederci',) aiy.audio.say ('Auf Wiedersehen',) pw (3) print ('bye! ') tawg # nres lub voj thiab xaus qhov kev pab cuam ntxiv: luam tawm (' Koj tau hais tias '', ntawv, '"') # Cia koj txheeb xyuas cov kev txhais lus, suav nrog kev sau npe aiy.audio.say ('Kuv twv koj hais',) aiy.audio.say (text,) # acustic pov thawj Text_up = text.upper () # hloov tag nrho rau cov ntawv sau loj (Text_up) Text_Len = len (Text_up) print (Text_Len) rau kuv hauv ntau (Text_Len): Lett = Text_up # Xaiv ib tsab ntawv, pib ua ntej, piv txwv li [0] luam tawm ("Tsab ntawv =", Lett) Lett_B = Braille_6A [Lett] # Xaiv cov cai sib xws los ntawm phau ntawv txhais lus Ib daim ntawv uas ploj lawm yuav ua txhaum txoj cai! print (Lett_B) yog ("1" hauv Lett_B): luam tawm ("LED 1") led_1.on () # qhib LED ntawm servo0 "yog" 2 "hauv Lett_B: luam tawm (" LED 2 ") led_2.on () yog "3" hauv Lett_B: print ("LED 3") led_3.on () yog "4" hauv Lett_B: print ("LED 4") led_4.on () yog "5" hauv Lett_B: print ("LED 5 ") led_5.on () yog" 6 "hauv Lett_B: luam tawm (" LED 6 ") led_6.on () pw (1) # tso saib qauv rau kev luam thib ob () led_1.off () # tsis ua haujlwm txhua lub LEDs ntawm servos0 -5n led_2.off () led_3.off () led_4.off () led_5.off () led_6.off () tsaug zog (0.3) # luv luv so so, los qhia qhov kawg ntawm tsab ntawv yog _name_ == '_main_ ': lub ntsiab ()

Kauj ruam 4: Outlook thiab Lus Cim

Yog li dab tsi tuaj yeem txuas ntxiv?

Ib sab ntawd IT meta-tso dag nrog AIY cov khoom siv video lossis lwm qhov kev siv lub tshuab pom duab tau hais hauv qhov kev qhia, yuav muaj lwm txoj hauv kev los nthuav lub tswv yim piav qhia hauv cov lus qhia no. Qee qhov ntawm lawv txawm tias yuav siv tau hauv ntiaj teb tiag. Cov no yuav yog:

- txhim kho cov phiaj xwm, yog li cov ntawv raug xa mus rau tus lej Braille tus qauv, nrog rau txhua qhov cim thiab ua kom nrawm. Qhov ntawd yuav tsum tsis txhob siv zog ntau rau tus kws tshaj lij nab nab. Kuv tsis yog, yog li yuav muaj kev pab zoo siab tos txais.

- nthuav qhov system mus rau 2x4 matrix. Yuav tsum muaj peev xwm ua tau ib yam, thiab yuav pab siv 8-dot Braille cov lej sib xws, raws li tau siv los ntawm cov ntawv Braille hluav taws xob. Saum toj no, nws yuav nyob ze me ntsis rau Dearheart clacks system.

- tsim qhov tseeb 2x3 lossis 2x4 Braille zaub. Yuav tsum muaj peev xwm siv tau ib qho array ntawm servos lossis array ntawm 5V mini solenoids. Thawj qhov kev sib tw yuav yog qhov kev ncua deb nruab nrab ntawm cov ntsiab lus siv tau yog 2.45 hli, lossis 1/10 nti, ntawm cov khoom siv hluav taws xob, yog li yuav tsum muaj qee lub zog thiab cov cuab yeej siv tshuab. Lwm qhov kev sib tw tuaj yeem yog txhawm rau tswj hwm qhov thawb ntev.

Xws li kev daws teeb meem yooj yim thiab pheej yig yuav yog qhov kev txaus siab rau cov pej xeem thoob plaws ntiaj teb, vim kev lag luam Braille cov lus nthuav tawm kim heev. Tej zaum yuav muaj txiaj ntsig rau cov neeg kawm Braille siv lub kaw lus tswj lub suab. Raws li lawv tuaj yeem hais lus kab lus (Askiv) kab lus ntawm lawv xaiv, thiab tau txais cov ntawv, ntawv thiab cov cim, pom ntawm lawv cov ntiv tes (s).

- tsim kho lub tshuab kaw lus zoo ib yam li Murray lossis Cov Kev Hlub Nyob Hauv. Siv servos, uas yuav tsum tsis txhob nyuab heev thiab tej zaum yuav piav qhia hauv lwm cov lus qhia. Los yog tuaj yeem yog txoj haujlwm zoo hauv tsev kawm. Leej twg txaus siab?

–――――

Qee cov lus hais thiab kev sib txuas ntawm kev txaus siab:

- Muaj cov lus qhia piav qhia "DIY semaphore lantern", 2x4 LED matrix, raws li qee qhov Propeller demo board. Kuv nyiam qhov teeb tsa, tab sis cov phiaj xwm zoo li nyuaj rau kuv. Thov saib koj tus kheej.

- Tam sim no kuv pom qhov kev pab cuam nab nab los tsim kom tau Daim Ntawv Cog Lus Ua Tau Zoo (Qib 2) Braille. Hmoov tsis zoo nws txwv rau nab hab sej 2 thiab 2002 Asmeskas Lus Askiv version:

- txoj haujlwm ua tiav ntau dua zoo li yog liblouis, https://github.com/liblouis/liblouis, tab sis kuv tsis muaj lub tswv yim yuav ua li cas koom ua qhov kev daws teeb meem no.

- qhov kev daws teeb meem nab nab zoo li tuaj ntawm tim Nkij teb chaws, https://github.com/ant0nisk/pybrl tuaj yeem ua ke ntau hom lus thiab tsim qib 2 Braille.

- Kuv tsis yog tus programmer, tsis yog tus txiv neej siv hluav taws xob, thiab kuv tsis tau paub ntau txog Braille ob peb hnub dhau los.

Yog li yog tias koj pom ib qho yuam kev, tsis suav nrog, lossis koj muaj qee lub tswv yim rau txoj haujlwm, thov qhia rau kuv paub.

- Yog tias koj nyiam cov lus qhia no, thov pov npav rau nws!

Pom zoo: