Esra Elazragh
Newbie level 4
hello
i new in interface between matlab and PIC, so i need some help how i can send data from matlab program by serial port to PIC .i am work to how control in dc motor depended on matlab output if output of matlab 0 the dc motor not work, if output of matlab 1 the dc motor will work , i am start in matlab code how open contact with PIC, but how sent the value to PIC.
here this part of my code
h out of sum calculation
in above code how send (b) to PIC to dc motor work
thanks for all and sorry for bad English :-(
i new in interface between matlab and PIC, so i need some help how i can send data from matlab program by serial port to PIC .i am work to how control in dc motor depended on matlab output if output of matlab 0 the dc motor not work, if output of matlab 1 the dc motor will work , i am start in matlab code how open contact with PIC, but how sent the value to PIC.
here this part of my code
Code:
if(h>90)
b=1
s = serial('COM2');
fopen(s)
fclose(s)
(here need dc motor work)
else
b=0
(here dc motor must be not work )
h out of sum calculation
in above code how send (b) to PIC to dc motor work
thanks for all and sorry for bad English :-(