No appropriate method, property, or field 'analogRead' for class 'arduino'.
조회 수: 3 (최근 30일)
이전 댓글 표시
I connect my arduion to matlab and everything is fine but when I tried to read the values that is come from LM32 sensor which I connect to port A0 by using analogRead(a,0) I get this error No appropriate method, property, or field 'analogRead' for class 'arduino'. **I am using matlab 2015 a
댓글 수: 0
답변 (2개)
Walter Roberson
2015년 5월 18일
analogRead() needs to be done in the code on the arduino side, not on the MATLAB side. See some sample code
댓글 수: 5
Walter Roberson
2015년 5월 19일
The LM32 does not output analog signals. The LM32 outputs digital signals on its SWD pin. The Master (arduino in this case) must signal the LM32 that it wants to read, and there is a protocol. See http://pdf.datasheetcatalog.com/datasheet2/a/0s6d7g5uzse6i36klqax64y9lcpy.pdf
I would suggest that what you were looking at was instructions for an LM35 sensor, as LM35 sensors encode their readings as voltage outputs.
There is a possibility that one of these will be of assistance to you:
- http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html
- http://playground.arduino.cc/Learning/OneWire
Before I do any more research, please confirm that you are using an LM32 Temperature Sensor, from National Semiconductor. There are a number of different temperature sensors from different manufacturers and will similar names, but which have quite different interfaces.
Walter Roberson
2018년 4월 9일
It turns out that analogRead() did exist, but it was for the Legacy arduino package. https://www.mathworks.com/matlabcentral/fileexchange/32374-legacy-matlab-and-simulink-support-for-arduino
Manohar Patel
2018년 10월 19일
편집: Manohar Patel
2018년 10월 19일
Hii @Mohammed Al-Mostafa your error is "No appropriate method, property, or field 'analogRead' for class 'arduino'". please 'analogRead' swap with 'readVoltage'. because some attributes are change in matlab2015.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!