05-01 LEDBrightness
From Manuals
(Difference between revisions)
Support (Talk | contribs)
(Created page with 'This program uses an analog input to control the brightness of an LED through a DAC output. /*Program Example 5.1: Uses analog input to control LED brightness, through DAC outp…')
Newer edit →
(Created page with 'This program uses an analog input to control the brightness of an LED through a DAC output. /*Program Example 5.1: Uses analog input to control LED brightness, through DAC outp…')
Newer edit →
Revision as of 15:21, 14 August 2014
This program uses an analog input to control the brightness of an LED through a DAC output.
/*Program Example 5.1: Uses analog input to control LED brightness, through DAC output
*/
#include "mbed.h"
AnalogOut Aout(DAC0); //defines analog output on Pin DAC0
AnalogIn Ain(A0); //defines analog input on Pin A0
int main() {
while(1) {
Aout=Ain; //transfer analog in value to analog out, both are type float
}
}


