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.
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 |
--- 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);
}