Connecting and testing the Grove (Seedstudio) 3-Axis Digital Compass

Looks like I have it connected correctly to the I2C port (left side , bottom connector).

Perhaps is too complex a program just to test the compass with.

Trying to run the and getting these errors:

pi@raspberrypi:~/gopigo/Software/Python/Examples/Compass_Robot $ python
Traceback (most recent call last):
File “”, line 53, in
File “/usr/lib/python2.7/lib-tk/”, line 3703, in init
Turtle._screen = Screen()
File “/usr/lib/python2.7/lib-tk/”, line 3552, in Screen
Turtle._screen = _Screen()
File “/usr/lib/python2.7/lib-tk/”, line 3568, in init
_Screen._root = self._root = _Root()
File “/usr/lib/python2.7/lib-tk/”, line 458, in init
File “/usr/lib/python2.7/lib-tk/”, line 1813, in init = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

In the, there are usually no mentions of setup, dependencies or test conditions.
The compass represents only a small part of the overall project so having to hack how-to’s on this will just slow me down.

Can you provide some directions on how to test the compass please?


I’m on a cell phone right now and I can’t really test things. My apologies for that. Are you by any chance connected to your Pi via ssh and not VNC?
Turtle needs a graphic display.


How did you guess?

Yes, I will try vnc instead.


1 Like

Hmm, cause I’m a mom and I have developed a sixth sense? :slight_smile:

More seriously, this line gave it away:

_tkinter.TclError: no display name and no $DISPLAY environment variable

1 Like