Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Query for sending data from matlab and receiving data in spark V robot using zigbee

Status
Not open for further replies.

shriram krishnan

Newbie level 4
Joined
Jan 21, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
I am doing a project on image processing in matlab.
I am sending some data from matlab using one zigbee connected to my pc to another zigbee mounted on Spark V robot.
When i send the data usinf fprintf() in matlab the led in zigbee module connected to computer glows.
But when the robot is turned on it is not receiving it or taking any action.
The data i am sending is some integer numbers like 2,4,6,8 to control the movements of robot like when i send 2 the robo should move forward,8 for backward etc.

so i want to ask where the problem exists actually.?whether in my matlab program or the c program i wrote in microcontroller to receive data.
can any one help me and tell me the code in c for spak v robot to receive data using zigbee and code in matlab to send data using zigbee.
 
Last edited:

Hi shriram first of all i guess your zigbee module is connected to the PC through serial port.In that case you can use the serial port class in matlab.using it is quite easy.first create a serial port object as follows

serPort = serial('comPort','Baudrate',57600,'DataBits',8,'Parity','none','StopBits',1);

here comPort(within single quotes) is the serial port to which zigbee module is connected.all others are self explanatory

fopen(serPort);
fwrite(serPort,128,'uchar');
fwrite(serPort,132,'uchar');
fclose(serPort);

here 128 and 132 are values transmitted as unsigned char.once char is transmitted close the port coz otherwise it can cause timeout or you can specify a large timeout value when you create serial port object itself

also make sure that your zigbee modules are configured properly(check with appropriate user manual for your modules)
 
thanks vishnu ,this post proved very helpfull to me.
thanks a lot

---------- Post added at 00:31 ---------- Previous post was at 00:23 ----------

thanks a lot vishnu
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top