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.
adc-pc.cpp@0:d288ab854d2c, 2016-08-17 (annotated)
- Committer:
- mfauzi
- Date:
- Wed Aug 17 07:23:56 2016 +0000
- Revision:
- 0:d288ab854d2c
- Child:
- 1:82052538b6d6
This code is for ToT ARM mbed at UTHM
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mfauzi | 0:d288ab854d2c | 1 | #include "mbed.h" |
| mfauzi | 0:d288ab854d2c | 2 | |
| mfauzi | 0:d288ab854d2c | 3 | Serial pc(USBTX, USBRX); |
| mfauzi | 0:d288ab854d2c | 4 | AnalogIn pot1(p19); |
| mfauzi | 0:d288ab854d2c | 5 | |
| mfauzi | 0:d288ab854d2c | 6 | int main() |
| mfauzi | 0:d288ab854d2c | 7 | { |
| mfauzi | 0:d288ab854d2c | 8 | pc.printf("Voltage Measurement"); |
| mfauzi | 0:d288ab854d2c | 9 | |
| mfauzi | 0:d288ab854d2c | 10 | while(true) { // this is the third thread |
| mfauzi | 0:d288ab854d2c | 11 | pc.printf("Voltage : %3.3f V \n",pot1.read()*3.3); |
| mfauzi | 0:d288ab854d2c | 12 | wait(1); |
| mfauzi | 0:d288ab854d2c | 13 | } |
| mfauzi | 0:d288ab854d2c | 14 | } |