Updated versions of this code are also available, using better methods and also supporting shift registers.
- https://stackblitz.com/edit/js-4pcwal?file=index.html Modern version for browsers supporting async / await. It also supports a 3rd block for latching the data into a shift register.
- https://stackblitz.com/edit/js-kxazxy?file=index.html A version written with setInterval and a state machine. Runs in old browsers. Latch support is available, but must be set with an option selection.
These are untested and I would very much like your feedback on them. If you see bugs, please let me know. The silence on this project has kept me from devoting any time to it, but please know that if you ask, I will respond and make corrections, etc...
I'd really like to work on a design for a little board to interface between either a shift register or a microcontroller. My idea is that perhaps one board can be made to serve both functions. e.g. You populate part of the board for I2C, and you populate a different part for a shift register.
The other option is to do two separate boards, in which case I would do the I2C to uC version first. It would be something like my RC Servo to uC adapter board:
https://hackaday.io/project/181972-rc-servo-adapter
but with locations to mount the electronics and 2 light sensors, either directly to the PCB or via wires. (note to self, remember to include strain relief holes. I always forget those).
If a final circuit for a shift register is tested, then I'll try to include a 3rd sensor and use one edge to pinout for a shift register chip.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.