Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a beginner.I can't understand how can i get the reading of IR sensors(6) in a function.I use a home-made sensor.so,i have no built in library.

share|improve this question
    
whats the output of your home-made sensor? – ARK Apr 20 at 19:41
    
Welcome to Arduino Stackexchange! Could you please tell more to us about your current hardware setup? Schematic would be nice. – Avamander Apr 20 at 20:31
    
A good place to start is by telling us more about your sensor. If you've built it, or someone has supplied it to you. What pins is it using? What model are they? What sort of a project is this? Although a beginner, what have you research and/or tried so far. Keep in mind, this isn't a place to get other people to do your homework – Madivad 2 days ago

Are you saying you are a beginner and have scratch built 6 IR sensors? If so I take my hat off to you. We need details on the sensors.

Do the sensors give a digital signal or an analogue signal? I'm going to guess digital and they go high when they detect something. You need to connect the detection signal line to a digital port on the Arduino.
Look for at the Examples that come with the Arduino IDE (which you have probably downloaded) and find one that reads a digital pin. Copy the example then hack it so you read the 6 sensors (6 Digital Input Pins) and print on or off for each of them to the serial port. This is a very basic solution to start with and prove the hardware works. Once you have this working you can move on to using interrupts, etc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.