I was starting another project with a Mega ADK, Should be the same as a Mega 2560.
On the A0 - A11 using 5 VDC from the card, with a dupont male to male jumper wire I find that the inpits are not where I expect them to be. Pins that read will read 5, 3.3 or 0 VDC when applied.
What is going on here??
Where Where
Attached Read
Physical Software
A0 - A0
A1 - A11
A2 - A2
A3 - no show
A4 - A6
A5 - A7
A6 - no show
A7 - A9
A8 - no show
A9 - A3
A10 - A4
A11 - A5
*/
//#include <SoftwareSerial.h>
// software serial #2: TX = digital pin 8, RX = digital pin 9
//SoftwareSerial portOne(14, 15); // 14 = TX 15 = RX
//SoftwareSerial portTwo(16, 17); // 16 = TX 17 = EX
int channelpin [] = {A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11};
int LowCal [11];
int HighCal [11];
int AnalogRead [11];
void setup() {
// put your setup code here, to run once:
for (int i = 0; i < 12; i++)
{
delay(20);
pinMode(channelpin[i], INPUT);
AnalogRead[i] = analogRead[i] (channelpin[i]);
}
Serial.begin(9600);
analogReference(DEFAULT);
}
void loop() {
for (int i = 0; i < 12; i++)
{ pinMode(channelpin[i], INPUT);
AnalogRead[i] = analogRead[i] (channelpin[i]);
Serial.print(i);
Serial.print(" ");
Serial.print(AnalogRead[i]);
delay(20);
Serial.print(" ");
}
Serial.println(" ");
delay (500);
// put your main code here, to run repeatedly:
// Select Analog Channels for Settings
// Do Low Cal
// Do High Call
// Set Minimum reading
// Set Maximum reading
// Set Averaging
// Set Rounding
// Set Name of Channel
// Set Local Display
//Select Com port settings
// Select Com port 1-4
// UP Link or Down Link
// Set Baudrate
// Set bits
// Set set stop bit
// Set set pairity
// Select Data Send
// Set acquition speed
}
Forgot last end of a remark. Should not have been included.
analogRead (channelpin*);* * ^* * ^* * what is this?* Good catch. an AnalogRead looked too much like analogRead so I changed AnalogRead to ChannelRead and all Works!! great to have another set of eyes when you have been up too long. This was my first attempt at using arrays since I wrote a database app in school about 18 years ago. I should have posted it in the next group. I can't see how it compiled and worked at all since you pointed out my mistakes. ``` */**************************************************************
Data Logger for the Arduino Due Processor 12 bit Analog *
Version 1.01 *
* 14 = TX 15 = RX portOne *
* 16 = TX 17 = RX portTwo *
* Testing on a Mega ADK *
* *
* *
* *
*/ #include <SoftwareSerial.h>
// software serial #2: TX = digital pin 8, RX = digital pin 9
SoftwareSerial portOne(14, 15); // 14 = TX 15 = RX
SoftwareSerial portTwo(16, 17); // 16 = TX 17 = EX
int channelpin [] = {A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11};
int LowCal [11];
int HighCal [12];
int ChannelRead [11];
void setup() {
// put your setup code here, to run once:
for (int i = 0; i < 12; i++)
{
delay(20);
pinMode(channelpin[i], INPUT);
}
Serial.begin(9600);
analogReference(DEFAULT);
}
void loop() {
for (int i = 0; i < 12; i++)
{ pinMode(channelpin[i], INPUT);
ChannelRead[i] = analogRead (channelpin[i]);
Serial.print(i);
Serial.print(" ");
Serial.print(ChannelRead[i]);
delay(20);
Serial.print(" ");
}
Serial.println(" ");
delay (500);
// put your main code here, to run repeatedly:
// Select Analog Channels for Settings
// Do Low Cal
// Do High Call
// Set Minimum reading
// Set Maximum reading
// Set Averaging
// Set Rounding
// Set Name of Channel
// Set Local Display
//Select Com port settings
// Select Com port 1-4
// UP Link or Down Link
// Set Baud-rate
// Set bits
// Set set stop bit
// Set set parity
// Select Data Send
// Set acquisition speed
}
_```*_ Thank you so very much dmjlambert.