So I was going to use a Teensy 3.2 that I found buried in a cabinet somewhere to make an EEPROM Storage device (with a shield I made) with the Arduino software. I was running some test code to get the serial and stuff working, and I came across this issue: the analog readouts (without any connections) are reading greater than 0. In fact, they read to be about a rough consistent 100 to 800 in the 0-1023 range. I am getting my information through the serial printout, of which seems to work. I checked with a meter, and there is no voltage traveling through that I can tell.
Here is what I was using to test it:
If it were printing a small variation (like a single digit number), I wouldn't be too concerned. What I want is for the 'NO Signal Found' as the error message when the sensor isn't getting a signal. I currently am running this without anything wired in with the exception of the mini USB. Thoughts???
Here is what I was using to test it:
Code:
int Sensor = A1;
float val;
int count = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(Sensor, INPUT);
}
int rx_byte = 0;
void loop() {
if (count == 0){
Serial.println("Connect Sensor to Port A1 (sauce) and type '1' to get value set");
delay(20);
count++;
}
if (count != 0){
val = (analogRead(Sensor));
}
if (Serial.available() >0) {
rx_byte = Serial.read();
if (rx_byte == '1'){
val = (analogRead(Sensor));
delay(100);
if (val > 0){
Serial.println(val);
val = (analogRead(Sensor));
delay(100);
Serial.println(val);
val = (analogRead(Sensor));
delay(100);
Serial.println(val);
val = (analogRead(Sensor));
delay(100);
Serial.println(val);
delay(100);
}
else {
Serial.println (" NO Signal Found. Check Your Wiring");
}
}
}
}
If it were printing a small variation (like a single digit number), I wouldn't be too concerned. What I want is for the 'NO Signal Found' as the error message when the sensor isn't getting a signal. I currently am running this without anything wired in with the exception of the mini USB. Thoughts???