Analog Accelerometer Adxl 326 help

I have ran the accelerometer on the arduino uno and had data stream through the terminal window. I would like some help on getting started on the Photon. Side note as of right now I’m just trying to get it started nothing fancy just want to learn.

I think the circuit should be setup like this?
The circuit:
analog 0: accelerometer self test
analog 1: z-axis
analog 2: y-axis
analog 3: x-axis
Ground : ground
3Vo : Vin

The link below shows how it’s setup on the Arduino. I think I should be able to modify this?

  1. List item

https://www.arduino.cc/en/Tutorial/ADXL3xx

So what is your question exactly? You can hook it up like you show, except that I think the Adxl326 should be powered from the 3.3V pin, not Vin (Vin output is 4.8 volts). The code in that reference should work for the Photon too. The only difference I can think of is that the Arduino analog goes from 0 to 1023, whereas the Photon’s goes from 0 to 4095. You’ll have to keep that in mind when you interpret the results.

The question is how do I use Particle.publish/Particle.varible in the code so I can send it to the dashboard and see some data?? I

Hmm, what have you tried so far?
Any of the samples here?
https://docs.particle.io/reference/firmware/photon/#particle-publish-
See result on
https://dashboard.particle.io/user/logs

Or here?
https://docs.particle.io/reference/firmware/photon/#particle-variable-
See result here
http://suda.github.io/particle-web-interface/
or
http://jordymoors.nl/interface/

1 Like