I am developing a wireless data logger using Analog Shield and chipKIT WiFire, and am struggling with unstable "analog.read" function behavior.
My code steps are as follows: 1) acquire analog voltage with Analog Shield, 2) save data into SD and 3) send the data with UDP over WiFi.
It works sometimes, but most of the time, it stops at an analog.read function. I cannot understand this inconsistent behavior. Below is the sample code which reproduces the same issue.
----- code starts from here -----
#include <MRF24G.h> // sketch works if this line is commented out
#include <DEIPcK.h> // sketch works if this line is commented out
#include <DEWFcK.h> // sketch works if this line is commented out
#include <analogShield.h>
#include <SPI.h> // include SPI.h after analogShield.h inclusion. otherwise fails
First, I doubt power shortage, so I have tried two different power supply configuration: via UART(J1), and an external 9V supply via DC plug(J15) with J16 jumper setting set to EXT, but no luck.
Question
tnag
I am developing a wireless data logger using Analog Shield and chipKIT WiFire, and am struggling with unstable "analog.read" function behavior.
My code steps are as follows: 1) acquire analog voltage with Analog Shield, 2) save data into SD and 3) send the data with UDP over WiFi.
It works sometimes, but most of the time, it stops at an analog.read function. I cannot understand this inconsistent behavior. Below is the sample code which reproduces the same issue.
----- code starts from here -----
#include <MRF24G.h> // sketch works if this line is commented out
#include <DEIPcK.h> // sketch works if this line is commented out
#include <DEWFcK.h> // sketch works if this line is commented out
#include <analogShield.h>
#include <SPI.h> // include SPI.h after analogShield.h inclusion. otherwise fails
void setup()
{
Serial.begin( 9600 );
}
void loop()
{
unsigned int count = analog.read( 0, false );
Serial.println( count );
delay( 50 );
}
----- code ends -----
First, I doubt power shortage, so I have tried two different power supply configuration: via UART(J1), and an external 9V supply via DC plug(J15) with J16 jumper setting set to EXT, but no luck.
Is there any possibility of library conflicts? FYI, I use modified version of "analogShield.h" library downloaded from https://forum.digilentinc.com/topic/2211-analog-shield-and-chipkit-wifire-compatibility/
Any input would be greatly appreciated.
Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.