Clear Filters
Clear Filters

How the function "readVoltage" (of Arduino package) works? Can I see its code?

1 view (last 30 days)
My goal is to plot data from Arduino (EMG signals). I wrote my own code for serial communication between Matlab and Arduino - I send data from Arduino (by IDE code) to the serial port and read and plot it in Matlab. I also wrote a code that works with Arduino package. It uses the built-in function "readVoltage". I have noticed that my code is as fast as the code with "readVoltage" function but, sometimes my code is stacked a little bit (I believe it happens because the PC processor busy with other programs). The code with "readVoltage" function seems to be more stable and also - it uploads itself the sketch to the Arduino ROM board without involving the Arduino IDE. Can I see the inside code of "readVoltage" function? for edit it and use it for my own needs?
  1 Comment
Sergio Valderrama
Sergio Valderrama on 8 Jan 2022
I have a similar problem, I am reading the temperature from a LM35 sensor and I have created my own code in the arduino environment but when reading the voltage, I find differences between the output of my program and the "readVoltage" function of Matlab. I also compared measuring voltage with a multimeter and I find that Matlab's "readVoltage" function works better.
I don't have a solution but I would also like to know if I can access this function.

Sign in to comment.

Answers (0)

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!