Reading potentiometer voltage in Simulink

Added by Joey Menicucci 7 months ago


I'm trying to read the output of a potentiometer in a Simulink display box. I've tried following the ADC example online but I'm still having no luck. I've double checked that the right COM port is selected and GPIO33 is connected. Everything works in Arduino IDE but I can't seem to get it to work in Simulink. Screenshot with my current settings is attached.

UPDATE: I got a little further but now having trouble building the code for the model. It generates the code for the model successfully but is encountering an error in post processing. The error is caused by "Make environment could not be found in the system." See below for full diagnostic.

Any help is appreciated!

Thank you for making Waijung 2!

  1. Invoking Target Language Compiler on ESP_test.rtw
  2. Using System Target File: C:\Waijung_2\targets\esp32\esp32.tlc
  3. Loading TLC function libraries
  4. Generating TLC interface API for custom data
  5. Initial pass through model to cache user defined code
  6. Caching model source code
  7. Writing header file ESP_test.h
  8. Writing header file waijung2_hwdrvlib.h
  9. Writing source file waijung2_hwdrvlib.c
  10. Writing header file rtwtypes.h
  11. Writing source file ESP_test.c
  12. Writing header file rtmodel.h
  13. Writing source file ert_main.c
  14. TLC code generation complete.
  15. Creating HTML report file ESP_test_codegen_rpt.html
  16. Successful completion of code generation for model: ESP_test
    Waijung 2: Post processing started.
    Waijung 2: Copying required header and source files to the target build directory.
    Waijung 2: Generating sdkconfig file
    'make' is not recognized as an internal or external command,
    operable program or batch file.
  17. Build procedure for model: 'ESP_test' aborted due to an error.
    The call to esp32_make_rtw_hook, during the exit hook generated the following error:
    Make environment could not be found in the system

The build process will terminate as a result.
Caused by:
Make environment could not be found in the system

Replies (1)

RE: Reading potentiometer voltage in Simulink - Added by Chandima Jayaneththi (จันทิมา) 7 months ago

Hello Joey,

Thank you for your interests in using Waijung 2.
Currently, Waijung 2 doesn't support Simulink external mode. If you need to get the ADC data from ESP32 to Simulink on a host computer, you have to send it using via UART or WiFi. In case if you need to send it via UART you can use UART Blocks or Printf Block. Otherwise you can use Wireless Communication Block (HIL) for sending the data via WiFi.

Could you please mention your Operating System and the Matlab version to clarify the above error that you are facing.