Page 1 of 1

Python's Duty Acceleration functions

Posted: Thu Jul 11, 2019 4:52 pm
by stu
Python's Duty Accel functions are the only ones with accel first. The serial functions have duty first, and all the cpp code has duty first.

Makes translating code pretty difficult!

Python library:

Code: Select all

	def DutyAccelM1(self,address,accel,duty):
		return self._writeS24(address,self.Cmd.M1DUTYACCEL,duty,accel)

	def DutyAccelM2(self,address,accel,duty):
		return self._writeS24(address,self.Cmd.M2DUTYACCEL,duty,accel)

	def DutyAccelM1M2(self,address,accel1,duty1,accel2,duty2):
		return self._writeS24S24(address,self.Cmd.MIXEDDUTYACCEL,duty1,accel1,duty2,accel2)
Arduino library:

Code: Select all

bool RoboClaw::DutyAccelM1(uint8_t address, uint16_t duty, uint32_t accel)

Re: Python's Duty Acceleration functions

Posted: Fri Jul 12, 2019 10:21 am
by Basicmicro Support
We haven't changed them because it would break old user code for no major benefit.

You are free to change the library however you see fit. We provide the source code to the python library specifically for that option.