by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Diff: main.cpp
- Revision:
- 0:8e159b6a1d6a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 15 21:16:20 2012 +0000 @@ -0,0 +1,12 @@ +/*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 + } +} +