Pic16f877a Project

immortall14

Joined Nov 8, 2020
5
Hello friends,
In the project in the picture, I want to measure the current with Pic over a 5 ohm resistor.(with RA1 pin) How can I do that?
For example: It says -4.55 mA in simulation. 0 is displayed in the display. (There is no problem in compiling the code.)

the code I wrote: (CCS C)
Code:
int16 adc2;
float sarj_akimi;
unsigned char sarj_akimi[];
delay_us(20);
delay_ms(100);