Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

ADC MSP430 delay(20)

$
0
0

I have a sinusoidal wave of 50Hz, this is the code that I used to read adc.

for(i = 0;i<20;i++)//chosen 20 values
{
  ADCValue = analogRead(analogInPin);
  delay(20);
  sample[i] = ADCValue;}
  

 

the results were correct with sine wave display at correct value, however, the signal is at 50Hz, hence this delay(20) is at the time period of each cycle of this waveform, Why am I getting the correct adc results rather than a constant value of each time it reads at the same point?

 

Please can someone answer, thank you so much!  


Viewing all articles
Browse latest Browse all 2077

Trending Articles