H48C 3-Axis Accelerometer
Ritu
Posts: 39
I am trying to program the Hitachi H48C_3-Axis with the Javelin, so I need to code in JAVA and the example given on the parallax website is in Basic, and I am having a hard time converting it to JAVA, is there anyone who would know how to have the accelerometer supply information to the Javelin in the programming language JAVA.
Thanks
Thanks
Comments
regards peter
Post Edited (Peter Verkaik) : 6/30/2006 8:59:59 AM GMT
Thanks
regards peter
Thanks again
what results that gives.
regards peter
·
Thanks anyway
regards peter
thanks
If not, it could be a bad chip. Do you have another chip?
regards peter
Thanks
·· Juts because the Javelin works fine doesn't mean something hasn't hapened to the Accelerometer, which is what Peter is suggesting.· By trying known code on a BASIC Stamp that would help narrow things down.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I added debug statements to print the refValue and adcValue for each reading.
Let us know if these values are always -1 as they are preset,
or if they have other values which indicates bits are read.
Edit: and notice I used pins 13, 14 and 15.
Change that to the pins you used in your wiring.
regards peter
Post Edited (Peter Verkaik) : 7/6/2006 8:24:25 PM GMT
thanks for all the help you have given me so far
The documentation for the javelin shiftIn() and shiftOut() tells such
initialization is required.
Try the attached program. I added initialization code at the start of main().
If results remain 0 or 1 for adc and ref, try other combinations for the
clk and data init values.
regards peter
thanks
interchange the clock, data and cs pins?
If the basic stamp worked, and you use the same
socket for the javelin and the same pin definitions
(so you know the wiring is correct), then it should work.
Edit: unless one of the used javelin pins is defect.
Have you tried pulsing a led on the clock, data and cs pin,
and have tried to read a button on the data pin?
Just to make sure your javelin pins·are ok.
regards peter
Post Edited (Peter Verkaik) : 7/7/2006 2:18:52 PM GMT