pin_adc_read
ANALOG mode, otherwise the return value of this function is undefined.
Wokwi is a digital simulator with basic analog support, so there is currently very limited analog simulation. Some parts which support analog output include the potentiometer, NTC temperature sensor, photoresistor, and analog joystick.
pin_dac_write
ANALOG mode, but the voltage will only update once the pin mode is set to ANALOG.
Simulator examples
- Analog API chip example — Simulates a 0-5V/0-ADC_MAX voltage source. One float attribute and one analog output.
- Dual Op-Amp chip example — Simulates a dual Op-Amp with 4 analog inputs, 2 analog outputs, 2 float attributes.
- R-C filter — Simulates a low-pass R-C filter with 1 analog input, one analog output, and 4 attributes.
- Signal generator and Scope — Simulates a signal generator with 5 attribute inputs and 1 analog output, and a scope with 4 digital inputs, 4 analog inputs and 4 attribute inputs. Chip code for both in Wokwi tabs. (Scope github)