Skip to main content

You are here

JeeNode Micro + Gravity Plug problem

3 posts / 0 new
Last post
gv
JeeNode Micro + Gravity Plug problem

I have connected the JeeNode Micro to the gravity plug and want to send the acceleration data via RFM12B. As soon as I add the lines “const int* p = sensor.getAxes(); p = sensor.getAxes();” in the program code the JeeNode Micro doesn’t send anything (with or without gravity plug). I guess the JeeNode Micro crushes. The JeeNode Micro is powered with 2 AA batteries, sending and receiving data with RFM12B works fine and the gravity plug works well with other JeeNodes. I would appreciate any help!

#include <JeeLib.h> MilliTimer sendTimer; char payload[] = "Hello from JeeNodeMicro!"; PortI2C myBus(2); GravityPlug sensor(myBus); int gravityRead () { const int* p = sensor.getAxes(); //crash? p = sensor.getAxes(); //crash? return -1; } void setup () { Serial.begin(38400); rf12_initialize(1, RF12_868MHZ,33); } void loop () { sendTimer.poll(1000); rf12_recvDone(); if (rf12_canSend()) { rf12_sendStart(0, payload, sizeof payload); } int diff; diff = gravityRead(); }
jcw

Are you getting any compile errors? Make sure also to use a recent gcc - older versions had problems with ATtiny code over 4 KB, generating incorrect code or linker errors (I think always the latter, but it made me very suspicious).

RAM consumption is very low, from what I can see in your code, so that's not the cause, probably.

gv

There are no compiler errors. I tried gcc 4.7.0 and the ATMEL toolchain with gcc 4.6.2 with Windows 7. The sketch works with the normal JeeNode.

Installation of gcc 4.7.0: http://andybrown.me.uk/wk/2012/04/28/avr-gcc-4-7-0-and-avr-libc-1-8-0-co...

Installation of gcc 4.6.2 (ATMEL toolchain): http://www.open-electronics.org/arduino-full-memory-upgrade-to-the-last-...

Are the any work arounds to get the data from the gravity plug / to avoid the crash?

Premium Drupal Themes by Adaptivethemes