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.
Dependents: Tutorial04_dspic33fI2cCom Tutorial06_motorPositionControl
Diff: Encoder_dspic33f.cpp
- Revision:
- 3:ad07e5b97132
- Parent:
- 2:57634dc24946
- Child:
- 4:bb36786e93b7
--- a/Encoder_dspic33f.cpp Tue Oct 29 05:52:44 2013 +0000
+++ b/Encoder_dspic33f.cpp Tue Nov 05 12:40:27 2013 +0000
@@ -20,6 +20,16 @@
i2c_.write( (address_<< 1) & 0xFE, &rst, 1);
}
+
+void Encoder_dspic33f::set_resolution(int16_t resolution){
+ char cmd = 'e';
+ char dat[3];
+ dat[0] = cmd;
+ dat[1] = GetByte(resolution,0);
+ dat[2] = GetByte(resolution,1);
+ i2c_.write( (address_<< 1) & 0xFE, dat, 3);
+}
+
void Encoder_dspic33f::set_resolution1(int16_t resolution){
char cmd = 'e';
char dat[4];