ARES
/
Timer
Time is good
Fork of Robot2016_2-0 by
Diff: AX12/AX12.cpp
- Revision:
- 71:5590dbe8393a
- Parent:
- 51:1056dd73a748
diff -r 176d04975f06 -r 5590dbe8393a AX12/AX12.cpp --- a/AX12/AX12.cpp Wed May 04 21:51:00 2016 +0000 +++ b/AX12/AX12.cpp Thu May 05 03:47:05 2016 +0000 @@ -98,6 +98,19 @@ return(rVal); } +int AX12::setSpeed(int speed) +{ + char data[2]; + + data[0] = speed & 0xFF; + data[1] = speed >> 8; + + // write the packet, return the error code + int rVal = write(_ID, 0x20, 2, data); + + return(rVal); +} + // set continuous rotation speed from -1 to 1 int AX12::setCRSpeed(float speed) {