[En-Nut-Discussion]Problem with ADC

Lars Andersson lars at larsandersson.com
Mon May 29 20:56:23 CEST 2006


Hi,
just guessing here, really did not try this

             for(;;)
             {
               ADCStartConversion();
               NutSleep(100);
               ADCRead(&adc_value);
               ...

Maybe this helps?

//Lars
 

> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de 
> [mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of 
> Tommaso Fabbri
> Sent: Monday, 29 May, 2006 18:15
> To: en-nut-discussion at egnite.de
> Subject: [En-Nut-Discussion]Problem with ADC
> 
> 
> This is my code:
>         ADCInit();
>         ADCSetChannel(0);
>         ADCStartConversion();
>         ADCSetMode (0);
>         ADCSetPrescale(ADC_PRESCALE_DIV64);
>         printf("Siamo QUA!!\n");
> 
>              for(;;)
>              {
> 
>               ADCRead(&adc_value);
> 
>               //printf("%u", adc_value);
>               //NutSleep(100);
>               vadc=adc_value*5/1024;
>               printf("%f\n", vadc);
>               
> //n=NutUdpSendTo(sock,inet_addr("255.255.255.255"), port,
> str, sizeof(str));
> 
>              }
> the resullt is f if don't connect anything to the channel.
> someone can give me an example of a read from the ad 
> converter. i am doing a
> spectre analyzer  and i need to translate analog signals. 
> someone can help
> me?
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> 




More information about the En-Nut-Discussion mailing list