hello! i am interfacing Arduino Mega 2560 with matlab, i have to control DC Motor speed using Matlab GUI by PWM technique, but its not working when i use analogRead/Write command. this shows error of "Undefined analogRead/Write..." and it is defined already... (while using digitalRead/Write command, it works. only problem in analog) Here is the Code.
clear a; global a; a= arduino('COM1') a.pinMode(7,'output'); a.pinMode(6,'output'); a.pinMode(5,'output');
av=a.analogRead(7); av=(av/1023)*255; a.analogWrite(7,av);
Can anyone help me please. Thanks in adv