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.
Dependencies: mbed
main.cpp@1:b86f099a314a, 2019-01-22 (annotated)
- Committer:
 - Jtroper
 - Date:
 - Tue Jan 22 20:14:53 2019 +0000
 - Revision:
 - 1:b86f099a314a
 - Parent:
 - 0:0e723924ae7c
 - Child:
 - 2:a17f7da1ca7c
 
Added trim pot
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| Jtroper | 0:0e723924ae7c | 1 | #include "mbed.h" | 
| Jtroper | 1:b86f099a314a | 2 | #include <iostream> | 
| Jtroper | 1:b86f099a314a | 3 | DigitalOut myRled(LED1); | 
| Jtroper | 1:b86f099a314a | 4 | DigitalOut myBled(LED2); | 
| Jtroper | 1:b86f099a314a | 5 | AnalogIn PotCheck(PTE20); | 
| Jtroper | 0:0e723924ae7c | 6 | |
| Jtroper | 0:0e723924ae7c | 7 | int main() { | 
| Jtroper | 1:b86f099a314a | 8 | float fPotValue = 0; | 
| Jtroper | 0:0e723924ae7c | 9 | while(1) { | 
| Jtroper | 1:b86f099a314a | 10 | //myRled = 1; | 
| Jtroper | 1:b86f099a314a | 11 | //wait(0.2); | 
| Jtroper | 1:b86f099a314a | 12 | myRled = 2*fPotValue; | 
| Jtroper | 0:0e723924ae7c | 13 | wait(0.2); | 
| Jtroper | 1:b86f099a314a | 14 | // myBled = 1; | 
| Jtroper | 1:b86f099a314a | 15 | //wait(0.2); | 
| Jtroper | 1:b86f099a314a | 16 | myBled = 2*fPotValue; | 
| Jtroper | 0:0e723924ae7c | 17 | wait(0.2); | 
| Jtroper | 1:b86f099a314a | 18 | cout<< "\rI can't do that Carter" << endl; | 
| Jtroper | 1:b86f099a314a | 19 | fPotValue = PotCheck.read(); | 
| Jtroper | 1:b86f099a314a | 20 | cout << fPotValue << endl; | 
| Jtroper | 0:0e723924ae7c | 21 | } | 
| Jtroper | 0:0e723924ae7c | 22 | } |