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@1:7cb2bf6babe2, 2020-04-15 (annotated)
- Committer:
- namcheol
- Date:
- Wed Apr 15 07:29:40 2020 +0000
- Revision:
- 1:7cb2bf6babe2
- Parent:
- 0:f31836d48420
lab02-constant-voltage
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| dshin | 0:f31836d48420 | 1 | #include "mbed.h" |
| dshin | 0:f31836d48420 | 2 | |
| dshin | 0:f31836d48420 | 3 | |
| namcheol | 1:7cb2bf6babe2 | 4 | AnalogOut vout(DAC0_OUT); //vout = DAC0_OUT |
| dshin | 0:f31836d48420 | 5 | |
| dshin | 0:f31836d48420 | 6 | int main() |
| dshin | 0:f31836d48420 | 7 | { |
| namcheol | 1:7cb2bf6babe2 | 8 | unsigned short v; |
| namcheol | 1:7cb2bf6babe2 | 9 | |
| dshin | 0:f31836d48420 | 10 | while (true) { |
| namcheol | 1:7cb2bf6babe2 | 11 | v = 0xFFFF * (1.5 / 3.3); //1.5 V when VDD = 3.3V |
| namcheol | 1:7cb2bf6babe2 | 12 | vout.write_u16(v); |
| namcheol | 1:7cb2bf6babe2 | 13 | thread_sleep_for(1000); |
| dshin | 0:f31836d48420 | 14 | } |
| dshin | 0:f31836d48420 | 15 | } |