Serial I/O with Basic Stamp
Show older comments
I'm trying to get a Parallax Basic Stamp to talk to Matlab over a serial port. The Stamp is connected to the same PC that Matlab is running on. If I start Matlab first and create a serial object, then when I start the Stamp I get an error "Can't open port: in use". But if I start the Stamp first, the Stamp runs fine - but then when I try to open the serial port from Matlab, it hangs on "fopen (s)", where s is my serial port object.
The Matlab code is simply
> s = serial('COM1');
> fopen (s)
and the BS code is
SEROUT 16, baudrate, ["A", 10]
This is with Matlab 6R13 in XP SP3 and a Basic Stamp 24p connected via a 9 pin serial line on COM1. There is at least one example on the web (mechatronics.poly.edu/projects/papers/BS2MatlabPaper.pdf) that claims such communication is possible, but I can't get it to work. What am I doing wrong? Any help would be greatly appreciated.
Answers (0)
Categories
Find more on MATLAB Compiler SDK 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!