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...

5 Steps 1 min read Medium

Step-by-Step Guide

  1. 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 ,
  2. Step 2: Set up a folder on your computer to save all of your work.

  3. Step 3: Create a MATLAB script.

  4. Step 4: Copy and paste the following code to your scripts.

  5. 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

J

Janet Foster

Creates helpful guides on organization to inspire and educate readers.

73 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: