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.
pot/pot.cpp
- Committer:
- dlweakley
- Date:
- 2016-11-14
- Revision:
- 11:ed9539245ea0
- Parent:
- 8:2abfdbf5a3b8
- Child:
- 12:65392ee77300
File content as of revision 11:ed9539245ea0:
#include "mbed.h"
#include "pot.h"
Pot::Pot(PinName _pin, int offset) : angle(_pin) {
offset=offset;
}
float Pot::get_angle(){
float a = angle.read()*360;
return a;
}
float Pot::get_voltage(){
float a = angle.read();
return a;
}
void Pot::set_offset(int angle){
offset = angle;
}