I have solved the problem by changing this part:

var word measure                                -- ADC value / PWM duty 
cycle

-- ---- mainline ----
forever loop
   measure = adc_read_low_res(ADC_CHANNEL)
   measure = measure *4
         -- get ADC result
   pwm1_set_dutycycle_ratio(measure)
    --pwm1_set_dutycycle_percent(100)
           -- copy to PWM duty cycle
end loop

Op donderdag 1 juli 2021 om 19:23:47 UTC+2 schreef hans:

> I have now downloaded the adc.jal from the latest discussion ( june 2021), 
> same result.
>
> Op donderdag 1 juli 2021 om 17:40:57 UTC+2 schreef hans:
>
>> Hello, it's me again
>> I have tested this sample. The PWM goes from zero to about 25% and 
>> again.. manual set of the PWM gives the normal result, so i feel there is 
>> something wrong with the ADC reading.
>> Hans
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/8202716d-2ae4-4407-8f6e-4a1e0181c1d8n%40googlegroups.com.

Reply via email to