119 int16_t result = _asosw.sendPacket(tx);
142 int16_t result = _asosw.sendPacket(tx);
168 return(_asosw.sendPacket(tx));
195 return(_asosw.sendPacket(tx));
214 return(_asosw.sendPacket(tx));
237 return(_asosw.sendPacket(tx));
261 SW_LE16(maximumChangecounts),0x55,
263 int16_t result = _asosw.sendPacket(tx);
274 (uint8_t)samplePeriod,
277 return(_asosw.sendPacket(tx));
304 int16_t result = _asosw.sendPacket(tx);
318 return(_asosw.sendPacket(tx));
336 int16_t
writeHysteresis(uint16_t lowLimit, uint16_t lowOutputValue, uint16_t highLimit, uint16_t highOutputValue, uint16_t initialOutputValue)
346 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
357 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
367 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
392 int16_t
writeRamp(uint16_t slowIncrement, uint16_t incrementThreshold, uint16_t fastIncrement,
Period samplePeriod,
RampMode rampMode)
399 (uint8_t) samplePeriod,
402 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
413 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
421 (uint8_t) rampMode, 0x55
423 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
462 int16_t
writePID(uint16_t kp, uint16_t ki, uint16_t kd,uint16_t target,
Period samplePeriod, uint8_t targetPin = 255,
bool biDirectional =
false)
472 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
482 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
490 (uint8_t)samplePeriod,
493 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
502 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
513 int16_t result = _asosw.sendPacket(tx);
if (result < 0) {
return(result); }
533 0x55, 0x55,0x55,0x55,
536 if (_asosw.sendPacket(tx, rx) >= 0)
538 return(rx[4] + (uint16_t)rx[5] * 256);
553 (byte)(target & 0xFF),(byte)(target >> 8),0x55,0x55
555 return _asosw.sendPacket(tx);
567 _asosw.sendPacket(tx, rx);
569 memcpy(&returnVal,&rx[4],4);
585 _asosw.sendPacket(tx, rx);
588 memcpy(&returnVal,&rx[4],4);
602 _asosw.sendPacket(tx, rx);
605 memcpy(&returnVal,&rx[4],4);
619 _asosw.sendPacket(tx, rx);
622 memcpy(&returnVal,&rx[4],4);
636 _asosw.sendPacket(tx, rx);
639 memcpy(&returnVal,&rx[4],4);
653 _asosw.sendPacket(tx, rx);
656 memcpy(&returnVal,&rx[4],4);
670 _asosw.sendPacket(tx, rx);
672 return ((uint16_t)(rx[4] + 256 * rx[5]));
693 SW_LE16(IndexInUserMemory),0x55,0x55 };
694 return _asosw.sendPacket(tx);
698 virtual uint8_t
pin() = 0;
#define SW_LE16(_a)
Convert a uint16_t to two bytes in little endian format for array initialization.
@ CONFIGURE_PIN_OUTPUTSCALE
(210)
Class for a Serial Wombat chip. Each Serial Wombat chip on a project should have its own instance.
int16_t writeScalingEnabled(bool enabled, uint8_t sourcePin)
Enable scaling and set which pin or public data is used as the input source.
int16_t writeTimeout(uint16_t timeout_mS, uint16_t timeoutOutputValue)
Enable a timeout value which will cause the output to go to a default value if not updated.
int16_t writeRateControl(Period samplePeriod, uint16_t maximumChangecounts)
int16_t writeHysteresis(uint16_t lowLimit, uint16_t lowOutputValue, uint16_t highLimit, uint16_t highOutputValue, uint16_t initialOutputValue)
Controls the output based on hystersis control.
uint16_t ReadLastTarget()
int16_t Enable2DLookupOutputScaling(uint16_t IndexInUserMemory)
Set Up 2D Lookup Output Scaling.
SerialWombatAbstractScaledOutput(SerialWombatChip &sw)
Constructor for the SerialWombatAbstractScaledOutput Class.
int16_t writeOutputScaling(uint16_t outputMin, uint16_t outputMax)
Reduces the output range from 0 to 65535 to user specified range.
int16_t writeRamp(uint16_t slowIncrement, uint16_t incrementThreshold, uint16_t fastIncrement, Period samplePeriod, RampMode rampMode)
Configure the scaled output block into Ramp control mode.
int32_t PIDGetLastProportionalEffort()
int16_t writeScalingTargetValue(uint16_t target)
The target input value for PID control.
virtual uint8_t pin()=0
Facilitates inheritance.
int16_t write1stOrderFiltering(Period sampleRate, uint16_t filterConstant)
uint16_t readLastOutputValue()
Request Last Output Value.
int32_t PIDGetLastEffort()
int16_t writeInputScaling(uint16_t inputMin, uint16_t inputMax)
Scale incoming values to a range of 0 to 65535.
int32_t PIDGetLastDerivativeEffort()
int32_t PIDGetLastIntegratorEffort()
int16_t writeScalingTargetValueResetIntegrator(uint16_t target)
int16_t writePID(uint16_t kp, uint16_t ki, uint16_t kd, uint16_t target, Period samplePeriod, uint8_t targetPin=255, bool biDirectional=false)
Configure the scaled output block into PID control mode.
int16_t writeScalingInvertedInput(bool inverted)
if enabled subtract the input value from 65535 before doing any other processing.
int32_t PIDGetLastIntegrator()
int32_t PIDGetLastError()
virtual uint8_t swPinModeNumber()=0
Facilitates inheritance.