by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

Dependencies:   mbed

main.cpp

Committer:
robt
Date:
2012-10-15
Revision:
0:8e159b6a1d6a

File content as of revision 0:8e159b6a1d6a:

/*Program Example 5.1: Uses analog input to control LED brightness, through DAC output
                                                                            */
#include "mbed.h"
AnalogOut Aout(p18);      //defines analog output on Pin 18
AnalogIn Ain(p20);         //defines analog input on Pin 20

int main() {
  while(1) {
    Aout=Ain;     //transfer analog in value to analog out, both are type float
  }
}