ADXL335 sensor code when interfacing with raspberry pi 3

#1

I cannot download the code for this project, i attached the link that will show what i am refering to below.
https://www.circuito.io/app?components=9269,9443,200000

I will be happy to hear from any representative.

Thank You

Jackton

0 Likes

#2

Hello Jackton,
The Code section for Raspberry Pi is not active (and won’t be active).
It only gives you the pinout should you choose to work with the GPIO library for python on Raspberry Pi.

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
# define pins
ADXL335_PIN_XOUT = 0
ADXL335_PIN_YOUT = 1
ADXL335_PIN_ZOUT	= 2
MCP3008_PIN_CS = 8

Since ADXL is an analog (and a quite old…) sensor, you would need an ADC to get it to be read from the Pi. I suggest you’d search for code examples for ADC, like this one:

Good luck!

1 Like