04-01 DACOutput
From Manuals
(Difference between revisions)
| (2 intermediate revisions not shown) | |||
| Line 3: | Line 3: | ||
DAC0 for the MBED-SDK and the Bambino line of microcontrollers is mapped to the following locations: | DAC0 for the MBED-SDK and the Bambino line of microcontrollers is mapped to the following locations: | ||
{| border="1" cellpadding="5" cellspacing="2" align="center" style="text-align: center;" | {| border="1" cellpadding="5" cellspacing="2" align="center" style="text-align: center;" | ||
| - | |+ align="bottom"|''' | + | |+ align="bottom"|'''DAC Ouput Connector Location''' |
| - | |''' | + | |'''LPC4330 PIN NAME''' |
|'''PIN NAME''' | |'''PIN NAME''' | ||
|'''BAM210E''' | |'''BAM210E''' | ||
| Line 37: | Line 37: | ||
} | } | ||
| - | The following image shows the | + | The following image shows the out of the DAC on a Digital Volt Meter. |
[[Image:BAM210_04_01.jpeg|center|]] | [[Image:BAM210_04_01.jpeg|center|]] | ||
Current revision as of 18:05, 17 September 2014
This example outputs 3 different values to the Digital to Analog Converter (DAC) every 2 seconds. It outputs 0.825V, 1.65V, and 2.475V. The DAC output is on pin A5 of J8.
DAC0 for the MBED-SDK and the Bambino line of microcontrollers is mapped to the following locations:
| LPC4330 PIN NAME | PIN NAME | BAM210E | BAM210 | BAM200E | BAM200 |
| DAC0 | P4_4 | J8-6 | J8-6 | S3-5 | S3-5 |
/*Program Example 4.1: Three values of DAC are output in turn on Pin DAC0. Read the output on a Digital Volt Meter.
*/
#include "mbed.h"
AnalogOut Aout(DAC0); //create an analog output on pin DAC0
int main()
{
while(1) {
Aout=0.25; // 0.25*3.3V = 0.825V
wait(2);
Aout=0.5; // 0.5*3.3V = 1.65V
wait(2);
Aout=0.75; // 0.75*3.3V = 2.475V
wait(2);
}
}
The following image shows the out of the DAC on a Digital Volt Meter.

