jowood4 / RHINESTONE

0 stars 1 forks source link

Pin naming comments added #5

Closed pedrodude closed 9 years ago

pedrodude commented 9 years ago

I seem to have got it working; seems as if it's picky about usb cables. I have some serial output for you below (using some comments I added). It seems to be flipping between modes without waiting for user commands (doesn't seem to respond to those either). I think I've either got a pushbutton switch that's stuck closed or there's something up with the if-elses, but I can't seem to find anything. Any ideas?

P

MODE_NORMAL ROUTINE
nan
I'm alive!
TRANSITION_TO_SLEEP ROUTINE
SLEEP_SIGNAL ROUTINE
MODE_SLEEP ROUTINE
I'm alive!
TRANSITION_TO_NORMAL ROUTINE
NORMAL_SIGNAL ROUTINE
MODE_NORMAL ROUTINE
nan
I'm alive!
TRANSITION_TO_SLEEP ROUTINE
SLEEP_SIGNAL ROUTINE
MODE_SLEEP ROUTINE
I'm alive!
TRANSITION_TO_NORMAL ROUTINE
NORMAL_SIGNAL ROUTINE
MODE_NORMAL ROUTINE
nan
I'm alive!
TRANSITION_TO_SLEEP ROUTINE
SLEEP_SIGNAL ROUTINE
MODE_SLEEP ROUTINE
I'm alive!
TRANSITION_TO_NORMAL ROUTINE
NORMAL_SIGNAL ROUTINE
MODE_NORMAL ROUTINE
nan
I'm alive!
TRANSITION_TO_SLEEP ROUTINE
SLEEP_SIGNAL ROUTINE
MODE_SLEEP ROUTINE
I'm alive!
TRANSITION_TO_NORMAL ROUTINE
NORMAL_SIGNAL ROUTINE
MODE_NORMAL ROUTINE
nan
I'm alive!
TRANSITION_TO_SLEEP ROUTINE
SLEEP_SIGNAL ROUTINE
MODE_SLEEP ROUTINE
I'm alive!
jowood4 commented 9 years ago

It seems like we should make sure the hardware is set up the same before really changing code.

  1. The pushbutton is normally high, and goes low when pressed. I used a pull-up resistor to 5V.
  2. Next, make sure the ADXL345 is working. There is a test sketch here: https://github.com/adafruit/Adafruit_ADXL345/blob/master/examples/sensortest/sensortest.pde You may have it already if you cloned this library from Github.