Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
and pins 13 and 11 are connected directly to my 4 x 1,5V battery pack
Pins 13 and 11 are GND and 6V
Pins 4 and 5 are the output of the Photoresistors . . . The result is none, because the sensor's output is always High! The hyperterminal always shows me " 255 ", independently of surrounding light . . . When I put pin 4 (connected to ADC port 0 ) connected to GND, hyperterminal shows "0"; when I connect it to 5V it shows"255"
se4=a2dConvert8bit(4);rprintf("%d\n",se4);
timer0init(); //initiate timer 0 system. sbi(DDRE, PE7); // Configure port E7 as OutputPORT_OFF(PORTE, 7); // Put bit '0' in port E7cbi(DDRE, PE7); //Configure port E7 as Inputreset_timer_0(); //restart counting time from the beginningloop_until_bit_is_set(PINE, E7); //wait until the capacitor fully chargesint time_value = tmer0getoverflowcount * 255 + TCNT0; //get the time it took for the capacitor to charge
while(1) { //get sensor data //timer0Init();//iniciar o timer 0 sbi(DDRE, PE7); //pin como output PORT_OFF(PORTE,7); //colocar 0 na saída //FLIP_PORT(DDRE, 7); //pin como input sbi(PORTE, PE7); // enable pull-up resistor for v1f and later cbi(DDRE, PE7); reset_timer_0(); //loop_until_bit_is_set(PINE, 7); while (!(bit_is_set(PINE, 7))){ } time_value1 = timer0GetOverflowCount()*255+TCNT0; sbi(DDRE, PE7); //pin como output PORT_OFF(PORTE,7); //colocar 0 na saída reset_timer_0(); loop_until_bit_is_clear(PINE, 7); time_value2 = timer0GetOverflowCount()*255+TCNT0; //time_value = bit_is_set(PORTE, 7); //output data to USB (use hyperterminal to view it) rprintf("%d R_Sensor=%d\n",cnt++,time_value1+time_value2); delay_ms(100); }
C:\MyAxon\FBOOT17.exe -b9600 -c2 -paxon.hex -vaxon.hex
COM 4 at 115200 Baud: ConnectedBootloader VFFFFFFFF.FFError, wrong device informations