How to Make a Blinking LED with a Raspberry Pi Board Using MATLAB
Install a Raspberry Pi support package to MATLAB first. , Set up a folder on your computer to save all of your work., Create a MATLAB script., Copy and paste the following code to your scripts.,Run that script by either type 1_BlinkingLED or double...
Step-by-Step Guide
-
Step 1: Install a Raspberry Pi support package to MATLAB first.
What about giving "D:\Training\RaspberryPi\MATLAB\Playground" a shot?, There are at least two ways to do this:
Either open MATLAB, choose "New Script".
Or use Notepad++ and build an .m file. , Save it with a name for example "1_BlinkingLED.m" (WARNING: in MATLAB, avoid using space in file name). mypi = raspi; for i = 1:10 writeLED(mypi,’led0’,1); pause(0.2); writeLED(mypi,’led0’,0); pause(0.2); end , -
Step 2: Set up a folder on your computer to save all of your work.
-
Step 3: Create a MATLAB script.
-
Step 4: Copy and paste the following code to your scripts.
-
Step 5: Run that script by either type 1_BlinkingLED or double click on it in the working directory.
Detailed Guide
What about giving "D:\Training\RaspberryPi\MATLAB\Playground" a shot?, There are at least two ways to do this:
Either open MATLAB, choose "New Script".
Or use Notepad++ and build an .m file. , Save it with a name for example "1_BlinkingLED.m" (WARNING: in MATLAB, avoid using space in file name). mypi = raspi; for i = 1:10 writeLED(mypi,’led0’,1); pause(0.2); writeLED(mypi,’led0’,0); pause(0.2); end ,
About the Author
Janet Foster
Creates helpful guides on organization to inspire and educate readers.
Rate This Guide
How helpful was this guide? Click to rate: