Devantech compass
Archiver
Posts: 46,084
I have uploaded Devan.bs2 to the files section. This demo program for
the BS2 reads via I2C either in single byte or two byte mode and
displays with debug.
It uses the I2C routines from wwww.high-techgarage.com.
The module was purchased from www.acrnoname.com and is made by
www.robot-electronics.co.uk
the BS2 reads via I2C either in single byte or two byte mode and
displays with debug.
It uses the I2C routines from wwww.high-techgarage.com.
The module was purchased from www.acrnoname.com and is made by
www.robot-electronics.co.uk
Comments
talking I2C from a BS2 but I'm not getting good clean results with the
program. The values coming out are ranging from 255 (the most common output,
regardless of orientation !) and across to 037 and back to 127. All without
moving the compass !?
The docs (http://www.robot-electronics.co.uk/htm/cmpsdoc.htm) talk of
pull-up resistors needed on the I2C bus. It says they are required on the
SCL and SDA lines and their values are dependent on clock speed. It also
says that the compass is designed to work up the the standard clock speed
(SCL) of 100KHz but can be driven at up to 1MHz. Do you have these resistors
in place in your circuit ? Do you have a circuit diagram I could look at ?
Thanks in advance (again !).
Justin.
Original Message
From: miked@t... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=voTsP2MZKcP17KAJIPwdd11L7pERqN2kFbWqlNpZop0CWxodoTbj0hM07ymntpQob9KB0OnzwOQl3TvfNo33x9c]miked@t...[/url
Sent: 27 August 2001 20:59
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Devantech compass
I have uploaded Devan.bs2 to the files section. This demo program for
the BS2 reads via I2C either in single byte or two byte mode and
displays with debug.
It uses the I2C routines from wwww.high-techgarage.com.
The module was purchased from www.acrnoname.com and is made by
www.robot-electronics.co.uk
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
power supply you use?
Also make sure module is not close to magnets, motors, electric
equipment.
> Thanks for posting this code Mike - I now understand the mechanics of
> talking I2C from a BS2 but I'm not getting good clean results with the
> program. The values coming out are ranging from 255 (the most common output,
> regardless of orientation !) and across to 037 and back to 127. All without
> moving the compass !?
>
> The docs (http://www.robot-electronics.co.uk/htm/cmpsdoc.htm) talk of
> pull-up resistors needed on the I2C bus. It says they are required on the
> SCL and SDA lines and their values are dependent on clock speed. It also
> says that the compass is designed to work up the the standard clock speed
> (SCL) of 100KHz but can be driven at up to 1MHz. Do you have these resistors
in
> place in your circuit ? Do you have a circuit diagram I could look at ?
Pull ups are always needed for I2C. I used the 'standard' value of 4.7K
I just hooked 2 pins from the BS2 to the compass module with the pull ups.
>
> Thanks in advance (again !).
> Justin.