#include
<SHIFT.bas>
' source in /Program Files/Coridium/BASIClib
SUB SHIFTIN (INpin, CLKpin, LSBfirst, cnt)
SHIFTIN can be used for devices
that are not covered by SPI, I2C or 1-Wire. Data is shifted in on
INpin, and a positive clock is sent on CLKpin for each
bit.
Data and shift counts are stored in 2 arrays defined in the #include file
DIM shiftValues(MAXshiftARRAY) ' values to be shifted in or out
While most other hardware functions use bytes, SHIFTIN is oriented for bit control. The shiftCounts of each shiftValues defines the number of bits that will be shifted out (1 - 32). If a shiftCounts is 0, it is assumed to be 8.
Data is shifted in at 300 Kbits/sec.