Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:b26c37ca560d, 2021-11-02 (annotated)
- Committer:
- cspista
- Date:
- Tue Nov 02 06:28:40 2021 +0000
- Revision:
- 0:b26c37ca560d
Final version
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| cspista | 0:b26c37ca560d | 1 | #include "mbed.h" |
| cspista | 0:b26c37ca560d | 2 | |
| cspista | 0:b26c37ca560d | 3 | AnalogOut dac(PA_4); |
| cspista | 0:b26c37ca560d | 4 | |
| cspista | 0:b26c37ca560d | 5 | int main() |
| cspista | 0:b26c37ca560d | 6 | { |
| cspista | 0:b26c37ca560d | 7 | |
| cspista | 0:b26c37ca560d | 8 | while(1) { |
| cspista | 0:b26c37ca560d | 9 | for (int i = 0; i < 4; i++) { |
| cspista | 0:b26c37ca560d | 10 | dac.write(float(i)/3.3f); |
| cspista | 0:b26c37ca560d | 11 | printf(" DAC: %4.1f\n", dac.read()); |
| cspista | 0:b26c37ca560d | 12 | wait(5); |
| cspista | 0:b26c37ca560d | 13 | } |
| cspista | 0:b26c37ca560d | 14 | } |
| cspista | 0:b26c37ca560d | 15 | } |