Page 1 of 1

ShiftOutEx 8-bit sends

Posted: 25 July 2008, 9:59 AM
by GTBecker
The System Library Reference suggests that the value in ShiftOutEx can be Int8/16. Int8 seems not to work, however. I can get the correct bits sent only with a shifted Int16, i.e.

Code: Select all

	Call ShiftOutEx(DataPin, ClkPin, 8, CUInt(255) * 256, &h04, 210)
Am I misinterpreting something?


Tom

Re: ShiftOutEx 8-bit sends

Posted: 25 July 2008, 17:58 PM
by dkinzer
GTBecker wrote:I can get the correct bits sent only with a shifted Int16
When shifting out data MSB first, the first bit to be output is always bit 15 irrespective of whether the supplied data value is 8-bit or 16-bit.

The documentation should be more clear, perhaps, that if you provide an 8-bit data value, it is merely promoted to a 16-bit value but not shifted in any way. To do this would require compile-time knowledge of the value of the "number of bits' parameter which is not always possible.