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@12:65392ee77300, 2016-11-14 (annotated)
- Committer:
- dlweakley
- Date:
- Mon Nov 14 21:00:01 2016 +0000
- Revision:
- 12:65392ee77300
- Parent:
- 11:ed9539245ea0
- Parent:
- 10:4dd96f046784
- Child:
- 20:8063c82bbb35
pot calibration w/ encoder;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| dlweakley | 8:2abfdbf5a3b8 | 1 | #include "mbed.h" |
| dlweakley | 8:2abfdbf5a3b8 | 2 | #include "pot.h" |
| dlweakley | 8:2abfdbf5a3b8 | 3 | |
| dlweakley | 11:ed9539245ea0 | 4 | Pot::Pot(PinName _pin, int offset) : angle(_pin) { |
| dlweakley | 11:ed9539245ea0 | 5 | offset=offset; |
| dlweakley | 8:2abfdbf5a3b8 | 6 | } |
| dlweakley | 8:2abfdbf5a3b8 | 7 | |
| dlweakley | 8:2abfdbf5a3b8 | 8 | float Pot::get_angle(){ |
| Snay22 | 10:4dd96f046784 | 9 | float a = angle.read()*340; |
| dlweakley | 8:2abfdbf5a3b8 | 10 | return a; |
| dlweakley | 11:ed9539245ea0 | 11 | } |
| dlweakley | 11:ed9539245ea0 | 12 | float Pot::get_voltage(){ |
| dlweakley | 11:ed9539245ea0 | 13 | float a = angle.read(); |
| dlweakley | 11:ed9539245ea0 | 14 | return a; |
| dlweakley | 11:ed9539245ea0 | 15 | } |
| dlweakley | 11:ed9539245ea0 | 16 | void Pot::set_offset(int angle){ |
| dlweakley | 11:ed9539245ea0 | 17 | offset = angle; |
| dlweakley | 8:2abfdbf5a3b8 | 18 | } |