X-Y Bargraph
Newzed
Posts: 2,503
I have just finished laying out a PC board for an X-Y bargraph.· The horizontal X and the vertical Y each have 16 LEDs.· The idea is to visually display the output of a Memsic.· The board has 8 SOIC chips and 64
SMD 1206 components.· Three boards will cost me $59.00 and there is no way I would ever use more than one, so I am looking for two adventurous souls to buy the other two boards.· I will write the basic program to read the Memsic and use its output to drive the LEDs.· If you take one of the boards you will get the program along with it if you like, although you may have to calibrate your own Memsic.· If you have ExpressPCB, PM me and I will send you a copy of the board layout so you can see what it looks like.
Sid
SMD 1206 components.· Three boards will cost me $59.00 and there is no way I would ever use more than one, so I am looking for two adventurous souls to buy the other two boards.· I will write the basic program to read the Memsic and use its output to drive the LEDs.· If you take one of the boards you will get the program along with it if you like, although you may have to calibrate your own Memsic.· If you have ExpressPCB, PM me and I will send you a copy of the board layout so you can see what it looks like.
Sid
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Sid
I have attached the code for the project.· An expert programmer can probably improve on it, but I wrote the only way I know.
Some notes - since some of the Memsic outputs are negative numbers I had some problems handling them, so I padded the values of Xtilt and Ytilt with 1000 so I would always be working in the positive area.
I don't have a board to work with yet so I'm not sure about the MSBFIRST/LSBFIRST·modes - I may have them backwards.· I got all the right answers for the four bytes going to the shift registers but I'll have to wait and see about the modes.
This progrm will run on anything from a BS2 on up.· The conditional #SELECT takes care of all the pulse width conversions.
The DEBUG screen displays the output of the Memsic and the BIN8 values of the four bytes going to the shift registers.
Sid
All parts are Digikey.· Parts cost is about $15.00, plus, of course, a Memsic and the PC board.
Sid
http://www.parallax.com/dl/docs/prod/compshop/TiltDispCntrl.pdf
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
Sid
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
Sid
I often stand on the shoulders of giants myself [noparse];)[/noparse]
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
That was the way I took it, Ryan. There was no insulting or belittling received.
Sid
Each LED represents 5 degrees of tilt, which is a bit much.· I'm going to change the scaling to maybe 4 degrees per LED - 32 degrees max - or maybe 3 degrees per LED - 24 degrees max.
I've attached a couple of pictures, one of the bare board and one of the board operating with the mask in place.· The LEDs are showing 20 degrees tilt left and 10 degrees tilt down (front end down).
I'll post a revised program as soon as I decide on the scaling.· Comments as to whether it should be 5, 4 or 3 degrees per LED would be helpful.
Sid
Sid