Cov txheej txheem:
- Kauj ruam 1: Scroll Bot Assembly
- Kauj Ruam 2: Nruab Pob thiab Codebase
- Kauj ruam 3: Configuring Slack Instance
- Kauj Ruam 4: Tsim Slack Channel, thiab Caw Koj Cov Neeg Hlau rau Channel
- Kauj ruam 5: Rub tawm SlackPiBot Source Code & Configure
- Kauj Ruam 6: Kho Kho Crontabs kom Pib Txais ntawm khau raj:
- Kauj Ruam 7: Tsis teb los tau: Ntxiv USB Cov Lus Hais Tawm
- Kauj Ruam 8: Tsis teb los tau: Ntxiv Wired Buttons rau Neeg Hlau kom Pom Cov Lus
- Kauj Ruam 9: Rub Nws Txhua Zaug Ua Ke thiab Xa Cov Zis Tawm rau Pi
- Kauj Ruam 10: Yeem: IFTT Kev Sib Koom
Video: Raspberry Pi Slack Scroll Bot!: 10 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Txoj haujlwm no suav nrog Raspberry Pi nrog Pimoroni Scroll Bot cov khoom siv (hloov kho nrog cov nyees khawm), Slack, thiab IFTT rau kev pom thiab hnov suab ceeb toom thaum cov vis dis aus youtube tau tshaj tawm rau npe!
Lub pob hloov kho rau cov khoom siv yog nyob ntawm yeem, nrog rau tus neeg hais lus tshaj tawm txog qhov tuaj txog ntawm cov vis dis aus tshiab.
Koj kuj tseem tuaj yeem siv qhov no los xa cov lus mus rau bot los ntawm kev ua qeeb los ntawm kev ua ntej "bot" ua ntej ntawm cov lus, xws li "bot nyob zoo ntiaj teb". "bot clear" yuav tshem qhov screen.
Kauj ruam 1: Scroll Bot Assembly
Ua kom tiav cov lus qhia rau kev sib sau Pimoroni Scroll Bot:
learn.pimoroni.com/tutorial/sandyj/assembl…
Kauj Ruam 2: Nruab Pob thiab Codebase
Nruab Pob Pob:
sudo apt-tau hloov tshiab & sudo apt-tau hloov tshiab -y
sudo apt-tau nruab mpg123
Nruab pob sej:
pip nruab flask
pip nruab psutil pip nruab slackclient
Ua raws li kev qhia ntawm Pimoroni's rau Pib Nrog Scroll Hat:
learn.pimoroni.com/tutorial/sandyj/getting…
uas suav nrog rub tawm cov qauv piv txwv cov cai thiab cov peev txheej:
curl https://get.pimoroni.com/scrollphathd | tsoo
Txij li lub vijtsam tau teeb tsa upside down hauv cov khoom siv neeg hlau, koj yuav tsum tsis ua raws txoj cai kom tig lub vijtsam 180:
$ sed -i 's/#scrollphathd.rotate (degrees = 180) /scrollphathd.rotate (degrees = 180)/g' /home/pi/Pimoroni/scrollphathd/examples/web-api.py
Kauj ruam 3: Configuring Slack Instance
Rau tsab ntawv los tham nrog Slack, koj yuav xav tau tus lej API API.
Pib los ntawm kev nkag mus rau hauv koj pawg Slack lub vev xaib (https://my.slack.com/services/new/bot) thiab xaiv lub npe siv rau koj tus bot, tom qab ntawd luam theej API API cim.
Kauj Ruam 4: Tsim Slack Channel, thiab Caw Koj Cov Neeg Hlau rau Channel
Koj tuaj yeem siv cov channel slack dav dav, lossis yog tias koj xav tau koj tuaj yeem tsim cov channel slack cais.
Hauv kuv qhov xwm txheej kuv siv #neeg hlau-claire-tswj
Koj yuav tsum caw koj tus neeg hlau mus rau hauv cov channel, lossis nws yuav tsis pom cov lus uas tau xa tuaj.
Kauj ruam 5: Rub tawm SlackPiBot Source Code & Configure
Rub lub slackPiBot sourcecode los ntawm git:
git clone
Hloov kho kab 29 nrog koj tus lej API:
slack_client = SlackClient ("xoxb-KOJ-API-KEY-HERE")
Hloov kho kab 34 nrog koj lub npe neeg hlau:
yog user.get ('lub npe') == "neeg hlau-claire":
Kauj Ruam 6: Kho Kho Crontabs kom Pib Txais ntawm khau raj:
Teeb tsa crontabs kom pib txiav ntawm khau raj:
crontab -e
Ntxiv cov hauv qab no rau hauv qab ntawm koj lub crontab:
@reboot python /home/pi/Pimoroni/scrollphathd/examples/web-api.py@reboot python /home/pi/slackPiBot/check_button.py @reboot python /home/pi/slackPiBot/forever.py/home/pi/ slackPiBot/slackPiBot.py >> /home/pi/slackPiBot/outputLog.txt 2> & 1
Kauj Ruam 7: Tsis teb los tau: Ntxiv USB Cov Lus Hais Tawm
Txog qhov haujlwm no, Kuv tab tom siv USB hais lus los ntawm Asmeskas Robotics - muaj nyob ntawm amazon lossis ebay.
Yog tias siv qee yam zoo sib xws, koj yuav tsum tau hloov lub kaw lus txheej txheem suab los ntawm kev hloov kho alsa teeb tsa (/usr/share/alsa/alsa.conf). Hloov cov kab hauv qab no:
defaults.ctl.card 1defaults.pcm.card 1
1 yog qhov ntsuas ntawm koj lub cuab yeej. Txhawm rau nrhiav tus lej ID ntawm koj lub cuab yeej USB, khiav aplay -l thiab nrhiav daim npav ID.
Kauj Ruam 8: Tsis teb los tau: Ntxiv Wired Buttons rau Neeg Hlau kom Pom Cov Lus
Cov kauj ruam no yog nyob ntawm yeem tab sis pom zoo kom tshem tawm cov lus ntawm lub vijtsam.
Kuv tau ntxiv ob lub laub khawm rau kuv tus neeg hlau, tab sis hauv txoj haujlwm no kuv tsuas yog siv GPIO17.
Tsab ntawv check_button.py uas khiav ntawm kev xaiv lub npav GPIO17 txhua ob peb lub milliseconds thiab yog tias kev nyuaj siab xa HTTP POST mus rau tus qauv tshuaj ntsuam kab ntawv kom pom lub vijtsam.
Kauj Ruam 9: Rub Nws Txhua Zaug Ua Ke thiab Xa Cov Zis Tawm rau Pi
Muaj 4 tsab ntawv uas ua haujlwm ua ke rau txoj haujlwm no:
/home/pi/Pimoroni/scrollphathd/examples/web-api.py/home/pi/slackPiBot/check_button.py/home/pi/slackPiBot/forever.py/home/pi/slackPiBot/slackPiBot.py
Tsab ntawv web-api tau muab los ntawm Pimoroni thiab yog daim ntawv thov web yooj yim los tswj lub vijtsam nrog POST cov lus txib.
Lub check_button sej tsab ntawv pov npav GPIO pins thiab thaum lub pob nyuaj siab xa HTTP POST mus rau lub vev xaib -api.py tsab ntawv.
Tsab ntawv forever.py ncaws tawm tsab ntawv slackPiBot.py kom ntseeg tau tias yog tias muaj qhov tsis raug lossis tsis raug cuam tshuam los ntawm slack, tsab ntawv tau rov pib dua kom tsis txhob muaj cov lus ploj.
SlackPiBot.py tsab ntawv txuas rau slack thiab saib xyuas cov channel rau cov lus pib nrog "bot" lossis tshaj tawm los ntawm IFTT. Yog tias muaj kev sib tw, nws yuav xa HTTP POST mus rau web-api.py tsab ntawv thiab tso tawm ntawm lub vijtsam.
Kauj Ruam 10: Yeem: IFTT Kev Sib Koom
Txoj haujlwm no tau tsim los ceeb toom rau kuv cov menyuam ntawm cov vis dis aus tshaj tawm los ntawm cov neeg lawv ua raws hauv youtube, vim tias lawv tseem hluas heev kom muaj lawv tus kheej iPhone lossis iPads. Kuv ua tiav qhov no los ntawm kev tsim IFTT cov zaub mov xa tuaj ceeb toom rau slack tswj channel ib zaug cov vis dis aus tau tshaj tawm.
Cov ntawv qhia wiki ua qhov nyuaj rau pom hauv ib kauj ruam, tab sis cov duab saum toj no qhia qhov kawg.
Pom zoo:
Scroll Tib Kab LCD: 4 Cov Kauj Ruam (nrog Duab)
Scroll Ib Leeg Kab Kab: Cov Kua Crystal Library muaj ob txoj haujlwm muaj txiaj ntsig scrollDisplayLeft () thiab scrollDisplayRight (). Cov haujlwm no scroll tag nrho cov zaub. Ntawd yog, lawv nqes ob kab ntawm 1602 LCD thiab tag nrho plaub kab ntawm 2004 LCD. Qhov peb nquag xav tau yog abi
Khawm rau Nas Scroll: 5 Kauj Ruam
Khawm rau Mouse Scroll: Kuv tau muaj ob peb lub computer nas nyob rau ntau xyoo thiab lub log log yog ib yam uas tas li tsis ua haujlwm lossis ua haujlwm tsis raug. Kuv feem ntau zam kev siv cov ntawv xaiv kom txog thaum tsis ntev los no thaum kuv txiav txim siab muab cov duab nraaj
Tsim Scroll View Nrog Swift: 9 Kauj Ruam
Tsim Scroll View Nrog Swift: Ob peb lub hlis dhau los, Kuv tsis paub tias muaj kev hloov pauv sai thiab Xcode. Hnub no, kuv muaj peev xwm los tsim ib feem me me ntawm daim ntawv thov uas kuv xav tsim. Kuv muaj peev xwm tsim qee yam txias, uas kuv xav qhia rau koj. Hauv qhov kev qhia no kuv yuav coj
Ua Rau Koj Tus Menyuam Scroll Log Zoo Li Butter: 6 Kauj Ruam
Ua Rau Koj Tus Menyuam Scroll Log Tsiv Zoo Li Butter: Ntxub qhov txhav, nyem lub log ntawm koj tus nas? Muab koj lub log rau nas kom zoo tshaj plaws, ua kom lub ntsej muag sib luag hauv 10 feeb
Kev Nyuaj Siab Scroll Log Nyem Tshem Tawm (Scroll du): 5 Cov Kauj Ruam
Cov Teeb Meem Tsis Txaus Siab Nyem Nyem Tshem Tawm (Scroll du): koj puas tau thab nrog lub suab ntawm lub log? zoo ntawm no yog koj txoj hauv kev los coj qhov nyem tawm ntawm cov ntawv ntawd! yog tias koj tsoo koj tus nas, nws tsis yog kuv qhov txhaum. Kuv ua qhov mod no nrog nas logitech. Kuv tsis paub tseeb tias nws yuav ua haujlwm ntawm lwm tus nas b