trungmanhhuynh Posted March 25, 2015 Share Posted March 25, 2015 Question 1: I changed a little bit to print out the value on passthrough code: #include <analogShield.h> //Include to use analog shield. #include <SPI.h> //required for ChipKIT but does not affect Arduino void setup() { //no setup Serial.begin(9600); } unsigned int count = 0; void loop() { count = analog.read(1); //read in on port labeled 'IN0' Serial.println(count); analog.write(0, count); //write out the value on port labeled 'OUT0' } I read values for all ADC pins 0->3. And I see that A0,A2,A3 read correct values with 32,000 for 0V, But for A1, this value is around 2200. Could you help me explain why that happens? Is that the Shield damaged ? Question 2: Is the default value around 45k, if I dont read anything ? COuld you help me answer ASAP ? Thank you Link to comment Share on other sites More sharing options...
trungmanhhuynh Posted March 26, 2015 Author Share Posted March 26, 2015 Another question is when I use it command : int count = 0 ; count = analog.signedRead(0,true); The value is always 32767. Link to comment Share on other sites More sharing options...
mwingerson Posted April 1, 2015 Share Posted April 1, 2015 1. Have you downloaded the latest version of the library here? https://github.com/mwingerson/analogShield 2. To determine if A1 is damaged, run this: #include <analogShield.h> //Include to use analog shield. #include <SPI.h> //required for ChipKIT but does not affect Arduino void setup() { //no setup Serial.begin(9600); } unsigned int count = 0; void loop() { count = analog.read(0); //read in on port labeled 'IN0' Serial.print(count); Serial.print(" "); count = analog.read(1); //read in on port labeled 'IN0' Serial.print(count); Serial.print(" "); count = analog.read(2); //read in on port labeled 'IN0' Serial.print(count); Serial.print(" "); count = analog.read(3); //read in on port labeled 'IN0' Serial.println(count); } Please take a screenshot of the serial output. 3. You probably only want to use analog.signedRead(0) without "true". Link to comment Share on other sites More sharing options...
Diagonal Posted February 17, 2016 Share Posted February 17, 2016 On 4/1/2015 at 5:51 PM, mwingerson said: 3. You probably only want to use analog.signedRead(0) without "true". Why would that be? Is the differential read just slow, or is there a bug? Link to comment Share on other sites More sharing options...
mwingerson Posted February 24, 2016 Share Posted February 24, 2016 No, the differential read is fine. Just I wouldn't use it unless I was meaning to use it. I suspected trungmanhhuynh wasn't using the differential mode. Hope this clears it up. Marshall Link to comment Share on other sites More sharing options...
Question
trungmanhhuynh
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.