Intermediate Filament Proteins Resource
Created & maintained by Roche de Guzman, Ph.D. (Assistant Professor / Biomedical Engineer)
Contact me at: roche0619@outlook.com
  • Hair Keratins
  • IF Proteins
  • Properties
  • Useful Links
  • Roche's CV
  • MATLAB
  • GRAPHS
  • ARDUINO
  • Citations

Turning On and Off LEDs with MATLAB Commands

11/24/2014

0 Comments

 
Digital Pin 2 = input
Digital Pin 3 = green LED output
Digital Pin 4 = red 1 LED output
Digital Pin 5 = red 2 LED output
MATLAB function: writeDigitalPin turns on (= 1) and turns off (= 0) the 5 V power source in the Command Window.
0 Comments
 

MATLAB Script Running To Customize LED Blinking

11/24/2014

0 Comments

 
%% Arduino test 1 LED MATLAB Script
% green blinking when push button is not pressed
% red blinking when push button is pressed
a = arduino;
configureDigitalPin(a,2,'input'); % pin 2 input
configureDigitalPin(a,3,'output'); % pin 3 output
configureDigitalPin(a,4,'output'); % pin 4 output
configureDigitalPin(a,5,'output'); % pin 5 output

% For Loop with delay to show the outcome of Push Button
for C = 1:100
    PB = readDigitalPin(a,2); % press button result
    if PB == 0
        for CC = 1:10
            writeDigitalPin(a,3,1); % green on
            pause(0.05);
            writeDigitalPin(a,3,0); % green off
            pause(0.05);
        end
    else
        for CC = 1:10
            writeDigitalPin(a,4,1); % red 1 on
            writeDigitalPin(a,5,1); % red 2 on
            pause(0.05);
            writeDigitalPin(a,4,0); % red 1 off
            writeDigitalPin(a,5,0); % red 2 off
            pause(0.05);
        end
    end
    pause(0.1);
end

0 Comments
 

Parallel Connection

11/24/2014

0 Comments

 
Since the two Push Buttons are in Parallel, either one can be pressed to light up the LED.
0 Comments
 

Series Connection

11/24/2014

0 Comments

 
The Push Buttons are in Series, hence to complete the circuit and light up the LED, both needs to be pressed simultaneously.
0 Comments
 

Simple Circuit

11/24/2014

0 Comments

 
When the Push Button is pressed, the circuit is completed.  The 22.73 mA current then lights up the LED.

V = 5 V; % supplied by the Arduino microcontroller connected to a PC
R = 220 Ω;
I = V/R = 5 V/220 Ω = 22.73 mA;



0 Comments
 

Powered by Create your own unique website with customizable templates.