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
- Committer:
- rjs718
- Date:
- 2019-03-06
- Revision:
- 2:060a86df835f
- Parent:
- 1:5b2bc7ec7b14
- Child:
- 3:4d7ff98b0e96
File content as of revision 2:060a86df835f:
#include "mbed.h"
#include "Terminal.h" //header file for terminal screen
Terminal term(USBTX, USBRX);
AnalogIn AI_in(PTB0);
PwmOut PWM_out(PTE21);
int main() {
PWM_out.period(.005);
while(1) {
if( AI_in.read() < .40){
PWM_out.write(.40);
}else{
PWM_out.write(AI_in.read());
}
term.cls();
term.printf("\nVrefV:\r\n %f", 3.3*AI_in.read(), AI_in.read());
term.printf("\nVrefADC/Duty: \r\n %f" ,AI_in.read() );
wait(.05);
}
}