Skip to content

Instantly share code, notes, and snippets.

@hekras
Created June 30, 2021 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hekras/b10ba5181e97a88caa3b7e86e74f9126 to your computer and use it in GitHub Desktop.
Save hekras/b10ba5181e97a88caa3b7e86e74f9126 to your computer and use it in GitHub Desktop.
Testing 2 modules on the PS Labs CMM2 Expansion cards
SETPIN 31, DOUT 'set pin 31 to latch the relay card
SETPIN 33, DOUT 'set pin 33 to latch the shift register card
SPI OPEN 195315, 0, 16 'mode 0, data size is 16 bits
LED2 = 1
LED1 = 1
do
if LED1 = &B0100000 then LED1 = 1
if LED2 = &B1000000000000000 then LED2 = 1
PIN(31) = 0
junk = SPI(LED1)
PIN(31) = 1
pin(33) = 0
junk = SPI(LED2)
PIN(33) = 1
pause(2000)
LED1 = LED1<<1
LED2 = LED2<<1
loop
SPI CLOSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment