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 MotorLab3Code
main.cpp@2:060a86df835f, 2019-03-06 (annotated)
- Committer:
- rjs718
- Date:
- Wed Mar 06 20:21:46 2019 +0000
- Revision:
- 2:060a86df835f
- Parent:
- 1:5b2bc7ec7b14
- Child:
- 3:4d7ff98b0e96
good shit right here;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rjs718 | 0:cb571e42343c | 1 | #include "mbed.h" |
| rjs718 | 2:060a86df835f | 2 | #include "Terminal.h" //header file for terminal screen |
| rjs718 | 2:060a86df835f | 3 | |
| rjs718 | 2:060a86df835f | 4 | Terminal term(USBTX, USBRX); |
| rjs718 | 0:cb571e42343c | 5 | |
| rjs718 | 0:cb571e42343c | 6 | AnalogIn AI_in(PTB0); |
| rjs718 | 2:060a86df835f | 7 | PwmOut PWM_out(PTE21); |
| rjs718 | 2:060a86df835f | 8 | |
| rjs718 | 2:060a86df835f | 9 | |
| rjs718 | 0:cb571e42343c | 10 | |
| Loganlp | 1:5b2bc7ec7b14 | 11 | |
| Loganlp | 1:5b2bc7ec7b14 | 12 | |
| rjs718 | 0:cb571e42343c | 13 | |
| rjs718 | 0:cb571e42343c | 14 | int main() { |
| rjs718 | 2:060a86df835f | 15 | PWM_out.period(.005); |
| rjs718 | 0:cb571e42343c | 16 | while(1) { |
| rjs718 | 2:060a86df835f | 17 | if( AI_in.read() < .40){ |
| rjs718 | 2:060a86df835f | 18 | PWM_out.write(.40); |
| rjs718 | 2:060a86df835f | 19 | }else{ |
| rjs718 | 2:060a86df835f | 20 | PWM_out.write(AI_in.read()); |
| rjs718 | 2:060a86df835f | 21 | } |
| rjs718 | 2:060a86df835f | 22 | |
| rjs718 | 2:060a86df835f | 23 | term.cls(); |
| rjs718 | 2:060a86df835f | 24 | term.printf("\nVrefV:\r\n %f", 3.3*AI_in.read(), AI_in.read()); |
| rjs718 | 2:060a86df835f | 25 | term.printf("\nVrefADC/Duty: \r\n %f" ,AI_in.read() ); |
| rjs718 | 2:060a86df835f | 26 | |
| Loganlp | 1:5b2bc7ec7b14 | 27 | wait(.05); |
| rjs718 | 0:cb571e42343c | 28 | } |
| rjs718 | 0:cb571e42343c | 29 | } |