Cov txheej txheem:

Tswj Raspberry Pi Siv Matlab: 5 Kauj Ruam
Tswj Raspberry Pi Siv Matlab: 5 Kauj Ruam

Video: Tswj Raspberry Pi Siv Matlab: 5 Kauj Ruam

Video: Tswj Raspberry Pi Siv Matlab: 5 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Image
Image
Txhim Kho Cov Khoom Uas Yuav Tsum Tau Muaj Hauv MATLAB
Txhim Kho Cov Khoom Uas Yuav Tsum Tau Muaj Hauv MATLAB

Hav, qhov kev qhia no yog hais txog kev tswj hwm koj lub taub hau raspberry pi siv matlab. Koj yuav tsum tau teeb tsa matlab mus rau qhov hloov tshiab kawg rau kev txhawb nqa rau pawg tshiab raspberry pi.

Khoom siv

Raspberry pi 3 (txhua tus qauv tshiab)

Matlab software

ib lub teeb LED

220 ohm resistor

Kauj Ruam 1: Txhim Kho Cov Khoom Uas Yuav Tsum Tau Muaj Hauv MATLAB

Txhim Kho Cov Khoom Uas Yuav Tsum Tau Muaj Hauv MATLAB
Txhim Kho Cov Khoom Uas Yuav Tsum Tau Muaj Hauv MATLAB
Txhim Kho Cov Khoom Uas Yuav Tsum Tau Muaj Hauv MATLAB
Txhim Kho Cov Khoom Uas Yuav Tsum Tau Muaj Hauv MATLAB
  • Nyem rau lub cim addon ntawm cov ntawv qhia zaub mov matlab.
  • Tshawb nrhiav MATLAB Txhawb Pob rau Raspberry Pi Kho vajtse
  • Rub tawm thiab teeb tsa pob
  • Ua raws cov txheej txheem rau thawj zaug teeb tsa nrog matlab

Kauj ruam 2: Tau txais Txoj Cai

Rub tus lej matlab los ntawm qhov txuas hauv qab no.

MATLAB File

Kauj ruam 3: Coding

rpi = raspi ('raspberrypi.mshome.net', 'pi', 'qwerty');

  • raspi yog siv los tsim kev sib txuas nrog raspberry pi los ntawm ssh
  • raspberrypi.mshome.net- IP ntawm pi pi-tus neeg siv lub npe ntawm koj pawg pi
  • qwerty-password ntawm koj tus lej siv

showPins (rpi);

showPins yog cov lus txib los qhia tus pin tawm kev sib txuas ntawm koj lub rooj sib tham pi. Koj tuaj yeem nrhiav tus lej GPIO tus lej siv qhov lus txib no

rau kuv = 1:10

writeDigitalPin (rpi, 21, 1); ncua (1); writeDigitalPin (rpi, 21, 0); ncua (1); kawg

  • rau lub voj yog siv los ua qhov kev txiav txim tshwj xeeb rau cov sijhawm tshwj xeeb.
  • writeDigitalPin yog siv los sau GPIO pins li siab thiab qis outputs ncua yog tsim ncua ncua teev nyob rau hauv cov nqe lus ntawm vib nas this

Kauj Ruam 4: Khiav Txoj Cai hauv Ntu

Khiav thawj ntu (CTRL+ENTER) thiab qhib qhov sib txawv uas tau tsim hauv chaw ua haujlwm.

  • Sim tshuaj xyuas qhov sib txawv hauv rpi.
  • Nws muab tag nrho cov lus piav qhia ntawm koj lub rooj tsav xwm pi zoo li tus lej tus lej, tus lej ntawm lub leds, i2c thiab txhua yam muaj nyob hauv nkoj.

Tom qab ntawd khiav ntu thib ob los tso saib raspberry pi board pin daim duab.

Saib xyuas tus lej GPIO tus lej los ntawm daim duab no

Hauv daim duab thib peb txheeb xyuas qhov coj ntsais tsis pom raws li qhov koj xav tau.

  • Koj tuaj yeem hloov tus nqi ncua los kho qhov ncua.
  • Hloov tus nqi txhawm rau txheeb xyuas tus naj npawb ntawm lub sijhawm koj xav kom ntsais muag kom ua tiav.

Kauj ruam 5: Nws yog

Yog Nws!
Yog Nws!

Koj tau ua koj thawj qhov kev sim ntawm raspberry pi siv matlab.

Pom zoo: