Closed rafaelcorsi closed 3 months ago
Thanks for reporting! I believe the issue here is that since we don't have the UI, the initial value for the potentiometer is 0, and is not read from the diagram.json. Looking into this.
Quick workaround: setting the pot value immediately after the simulation starts, e.g.
name: exe1
author: Rafael Corsi
version: 1
steps:
- delay: 1ms
- set-control:
part-id: pot1
control: position
value: 0.5
- delay: 300ms
- wait-serial: 'adc 1: 2047'
Fixed - the initial value of potentiometer should now match between wokwi.com and the CI.
Thanks again for the detailed report with a reproduction repo, it really helped in reproducing and solving the issue as quickly as possible.
It worked! thanks!
By the way, I owe you a message on LinkedIn so we can talk, I want to show you how I integrated your tool into my course
Fixed - the initial value of potentiometer should now match between wokwi.com and the CI.
Thanks again for the detailed report with a reproduction repo, it really helped in reproducing and solving the issue as quickly as possible.
Very curious to hear about that :)
Hi! I noticed there might be an issue with the ADC functionality when using it via the CLI. To facilitate reproduction of the bug, I've created an example project available at:
Description:
The project consists of a simple C program for the RP2040/Pico/PicoW that reads from the ADC and outputs the analog value to the UART/terminal. When simulating the circuit using the diagram simulation, everything works correctly. However, when executing the simulation through the Wokwi CLI with wokwi-cli --scenario test.yml, the ADC value is consistently reported as 0.
I've also tested connecting the ADC port on PICO to the VCC, to check if the problem is with the potentiometer, and it gives the same value, so I think that the problem is on the pico side.
Diagram works!
wokwi-cli erro