Testdriving the MaxO Module on my Spider was fun. Not much on the fora as of yet, so i had to learn as i got along.
During my experimenting,I discovered a few things, that the next person to start off with the MaxO can use as a starter.
I also found , what appears to be a little BUG in the DLL. When using the WritePin command, pins no 8,16,24 and 32 do not respond to the function.
I looked into the source, and sadly it goes a little beond my knowledge of bitshifting and bit manipulating… but i DID find that the WritePin also uses the
WriteArray Function, and that workes fins, so the error is most probably in the WritPin Function.
I ran some teste and found that when pins 1-7 are passed as _pin parameter, the Byte that is written when the register contained 00000000 is 1,3,7,15,31,63,127 (and that works), but when _pin is 8, (it should set the byte to 254 in this case), the byte is set to 0… (and that goes the same for each byte…
Maybe one of you BitWise men or women can look at the code and change it for e next release…
OK. from what i DID get to work i learnt a few facts that i wish to share for other newbies that might want to start off with the maxO board. I sure am goint to order a few more boards, as i have some ideas where i would need about 100 pins…
Using the Gadgeteer DLL, you have a nice set of functions to make things “easy” ish.
you have to start by telling the Spider how many board you have chained… maxO.NumBoars=1 (in my case)
next you have to Enable the outputs… maxO.EnableOutputs();
then you can either write a complete register (all the pins as bits in an array of bytes (4 bytes per board).
or change ONE pin…WritePin(board,Pin,position)
The register bytes start counting from the last board & last Pin… That has to do with the LSB being to the right of the board(s)
When an Enablecommand is sent, All Pins will be set HIGH (3.3v)
sending maxO.WritePin(1,3,false); will switch OFF (set to LOW) pin 3 from the left…
(exept for pins 8,16,24 and 32, because of a bug, but i Expect that to be solved shortly…