Using arduino uno, getting error message, seems to be a syntactic error...???
had a couple other drafts, in one I was able to read on my serial monitor "1" for still accelerometer and "11" for moving accelerometer (when code read steps + 1... )
in another, I was able to read nothing for still accelerometer, and "1" for moving accelerometer
this draft won't compile successfully
I would like it to start at 0 on serial monitor, and increase by one each time accelerometer moves on any of 3 axis
Help is appreciated, go easy on me, im a beginner
this is my code - error message: expected ')' before 'x'
const int xpin = A0;
const int ypin = A1;
const int zpin = A2;
int Steps = 0;
int x = 1;
void setup()
{
pinMode (xpin, INPUT);
pinMode (ypin, INPUT);
pinMode (zpin, INPUT);
Serial.begin (9600);
}
void loop()
{
int a = analogRead (xpin);
delay (500);
int b = analogRead (ypin);
delay (500);
int c = analogRead (zpin);
delay (500);
if (a < 678)
 {
  Serial.print (Steps ++x);
 }
if (b <= 464 )
 {
  Serial.print (Steps ++x);
 }
if (c <=4 )
 {
  Serial.print (Steps ++x);
 }
if (a >= 680)
 {
  Serial.print (Steps ++x);
 }
if (b >= 674)
 {
  Serial.print (Steps ++x);
 }
if (c > 6)
{
 Serial.print (Steps ++x);
}
}
I don't know. maybe that line shouldn't be there? I thought that would set the value of x equal to one for the point when its used in the ++x addition part. but you're saying ++x isn't valid...?
I made this all from scratch and I honestly don't know what im doing!
I didn't either when I first played with an Arduino.
you're saying ++x isn't valid...?
No, I said Steps ++x is not valid.
I tried it as (steps ++)
now in the serial monitor its going: 01234567..etc without me moving the accelerometer
So we'll have to find out why that's happening.
Add these lines to void loop(), right before if (a < 678):
Serial.print(a);
Serial.print("\t"); // tab character
Serial.print(b);
Serial.print("\t");
Serial.println(c); // println() moves the cursor to a new line after printing
Now, if you run the sketch, you can see the values of a, b and c, and deduct which part(s) of the code is/are causing the printing of 01234 etc....
the only problem is that the numbers are increasing without the accelerometer moving at all
the hope was that the count would increase by one each time the accelerometer moves...here its just going up automatically without moving the accelerometer at all