Pulsetronics
Member level 3
- Joined
- Oct 31, 2014
- Messages
- 67
- Helped
- 9
- Reputation
- 18
- Reaction score
- 9
- Trophy points
- 8
- Location
- Lagos
- Activity points
- 382
// using mikroC as compiler
Float i;
Char volt[6];
While(1){
I = Adc_read(0);
I = I * 5000/1023;
I= I /10 ;
Floattostr(I, volt);
Volt[5] = 0;
Lcd_out (1,1" Ac voltage: ");
Lcd_out_cp(volt);
Delay_ms(1000);
}
// using mikroC as compiler
Float i;
Char volt[6];
While(1){
I = Adc_read(0);
Delay_ms(1);
I = I+I;//1
Delay_ms(1);
I = I+I;//2
Delay_ms(1);
I = I;//....n
Delay_ms(1);
I = I/n
I = I * 5000/1023;
I= I /10 ;
Floattostr(I, volt);
Volt[5] = 0;
Lcd_out (1,1" Ac voltage: ");
Lcd_out_cp(volt);
Delay_ms(1000);
}
char volt[17];
I = Adc_read(0);
char volt[17];
I = Adc_read(0);
Why, particularly? In addition, I won't consider 100 nF as a large capacitor.ADC doesn't like to have a large capacitor on his input
Thanks to you betwixt but the truth is whenever am measuring DC volts I don't face problems like this, I will surely take different samples before conversion but I strongly believe that its hardware problem.
#define samples 10
char x = samples;
unsigned int average = 0;
while(x)
{
average += (unsigned int)Adc_read(0);
x--;
}
average /= samples;
The mikroC PRO for PIC identifiers aren't case sensitive by default, so that Sum, sum, and suM represent an equivalent identifier.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?