i am using avr atmega8 microcontroller....i am getting no idea how to read the value of a pin,I have used a IR sensor in that pin.
abhijit (EEE) 0 Newbie Poster
Recommended Answers
Jump to PostI believe this should work:
unsigned char porta_input; porta_input = PINA;
Try going through this tutorial from Purdue to learn more about programming with the AVR microcontrollers:
http://www2.tech.purdue.edu/eet/courses/referencematerial/atmel/
Jump to Postthe documentation is very necessary for you.
Here iam sharing a code i used on AVR atmega8, for 'Line Follower'
Your purpose must be different, but the complete code here may help you.#define F_CPU 12000000UL // define cpu frequency for delay function #include <avr/io.h> // includes …
All 5 Replies
Adak 419 Nearly a Posting Virtuoso

Mouche
abhijit (EEE) 0 Newbie Poster

Mouche
vinayakgarg 6 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.