Problem:
Hyperterminal is reading number from 14 to 17 but does not read from the PC5(ADC5) of the ATmega8
1. Hyperterminal is functional;
2. Receiving readings from the $50 robot; and
3. Not receiving signal from PC5 pin of the Photoresistor sensor.
Troubleshooting done so far:
A. Photoresistor Voltage Divider Circuit work fine on the Photoresistor sensor:
photoresistor: 5-10 Khoms;
Lights : 2.7 Volts; and
No light: 1.0 Volt.
B. Hyperterminal reading:
Photoresistor sensor on:
- PC5(ADC5): from 14 to 18; and
- Off PC5 : from 14 to 18.
I think the problem is not in the hardware but in the software.
Using the original Photovore_v1:
Parts of the Photovre codes at the beginning:
//store sensor data
sensor_left=a2dConvert8bit(5);
Parts of the codes towards the end:
//rprintf("Initialization Complete\r\n");
//output message to serial (use hyperterminal)
rprintf("Hello, World! Read My Analog: %d\r\n", sensor_left);
delay_cycles(2500);//a small delay to prevent crazy oscillations
Question I have no answer:
1. Could the problem be that the variable "sennsor_left" is not receiving data?
2. Could "a2dConvert8bit(5)" is not define to pin PC5?
Any help would be really appreciated. Thank you in advance