Wrapper library for controlling servos using Designer Systems DS-SCX18.Shield servo driver. See http://www.designersystems.co.uk/SCX18.S_info.htm
Revision 3:1812150d7a4d, committed 2016-04-27
- Comitter:
- Ingram
- Date:
- Wed Apr 27 17:11:38 2016 +0000
- Parent:
- 2:e5bc45ecdaca
- Commit message:
- Fix last commit
Changed in this revision
SCX18S.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e5bc45ecdaca -r 1812150d7a4d SCX18S.cpp --- a/SCX18S.cpp Wed Apr 27 17:09:28 2016 +0000 +++ b/SCX18S.cpp Wed Apr 27 17:11:38 2016 +0000 @@ -1,11 +1,9 @@ #include "mbed.h" #include "SCX18S.h" -extern Serial serial; - SCX18S::SCX18S(PinName p_sda, PinName p_scl, bool j_a0, bool j_a1) : i2c(p_sda, p_scl) { - i2c_address = (SCX18_I2C_BASE_ADDR | (j_a0 << 1) | j_a1) << 1; + i2c_address = (SCX18_I2C_BASE_ADDR | ((!j_a0) << 1) | (!j_a1)) << 1; } SCX18SServoStatusRegister SCX18S::readStatus(uint8_t channel) @@ -52,7 +50,6 @@ void SCX18S::writeRegister(uint8_t reg, uint8_t value) { - serial.printf("writing %d to %d\r\n", reg, value); char i2c_data[] = {reg, value}; i2c.write(i2c_address, i2c_data, 2); }