ArduinoOnPc icon indicating copy to clipboard operation
ArduinoOnPc copied to clipboard

Some plan for emulating digitalRead() ?

Open Lecrapouille opened this issue 3 years ago • 2 comments
trafficstars

Any idea on how to emulate digitalRead in https://github.com/ChrisMicro/ArduinoOnPc/blob/master/src/cores/arduino/wiring_digital.cpp#L35 ?

  • Keyboard cannot be used since can interfering with serial link.
  • Like kernel polling files and doing some echo "1" > gpio_3
  • Other idea ?

See also https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/issues/8

Lecrapouille avatar Jul 02 '22 16:07 Lecrapouille

Using a file input could be a good solution. This would also account for analogRead. Another (but more difficult to implement solution) could be to make a graphical interface input. Just using the functions in the button example
https://github.com/ChrisMicro/ArduinoOnPc/tree/master/examples/guiButton
as an interactive input.

ChrisMicro avatar Jul 03 '22 12:07 ChrisMicro

Yes kind of integrated GUI (like GTK+, DearIMGui ...)

Lecrapouille avatar Jul 04 '22 17:07 Lecrapouille