Go Down

Topic: analog input issuses (Read 3 times) previous topic - next topic

HazardsMind

Ok you have the pull down resistor wired correctly, I'm assuming.

You don't need to make them analog unless your reading varying voltages, or resistances, I mean it will work, but you don't need it.

Just for now make the buttons and switches, digital, that way all you need to see is if it is HIGH or LOW.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

warrenf

ok. all the digital pin are being used. and the origanal 5 that were the switches are damaged. this is y im using analog.

HazardsMind

Ok but, I just want you to test the buttons and switches without anything else on the arduino. When you know for sure that everything is working ,you can move them the analog pins. You need to see if you get either 1 or 255 when it is HIGH, and 0 for LOW
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

AWOL

You could do a very simple ASCII "logical analyser".
Set all I/O pins (except pins zero and one!) to be inputs in "setup()", and enable their pullups.
In "loop()", digitalRead every pin and Serial.print its value as one or zero, and at the end of "loop()", call "Serial.println()" so all the results are on a single line.
As the program is running, simply ground a pin at a time, and check that the display in the serial monitor reflects this.
This program shouldn't be more than a dozen or so lines.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

warrenf

hey guys thanks for the advice i did the serialwrite thing to check if its picking up the inputs. and when i run the simple sketch it picks up all the buttons .
but when i put the end cct together it will not pick up the start stop button. but picks up all the others?
any ideas?

AWOL

Quote
any ideas?

Post code.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

warrenf

its the code i posted at the beginning of the thread

warrenf

hey so iv figured out that the problem is not hardware. its in the sketch. iv stared at it for hours and cant figure out what the problem is. can some one take a look?

dhenry

Then how did you determine that it is software not hardware?

AWOL

Code: [Select]
const int startPin = A0; //input for begin button
void setup ()
{
  pinMode(startPin, INPUT);
  Serial.begin(9600);
}

void loop ()
{
  Serial.println (digitalRead (startPin));
}


What does that do? (uncompiled, untested)

What is connected to digital pin 2?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

warrenf

i loaded the sketch and all buttons work. cept the start button.
so i changed the sketches buttons allocations, so changed the start and up around.
same story. what used to be the start buttons works now to increase the values,
but it still wont start when you press the new start button

hope that makes sense

AWOL

Quote
other thing you should probly know is that i made a boo boo and stuck 9v threw the 5 inputs this is y im trying to use the analog input.
silly me.

Uh-oh!
You're assuming that the interrupt functionality of pin 2 transfers to A0?
Sorry.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

warrenf

ya the sketch didnt have a wake up function to wake the camera up after longer intervals so was goin to make pin 2 the wake up pin.

warrenf


AWOL

Use pin change interrupts, or replace the processor are the first two that spring to mind.
The second is my favourite.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview