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.

No of steps using uart

Status
Not open for further replies.

Rohith_elec

Full Member level 4
Joined
Dec 16, 2011
Messages
198
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,470
How can I send the number of steps of stepper motor using uart ?

or

is there any way to parse the string from uart to int in mikroC
 
Last edited:

Except for missing sscanf(), all usual means of the C-language can be applied. It usually ends up in a combination of string processing and atoi() for conversion of decimal to numbers.
 
can you give some backbone for the conversion ?
 

No, because nothings has been said yet about the message format. Besides numeric arguments, there are usually elements like command tokens, field delimiters and frame delimiters.
 

The message format will be

+s_num

or

-s_num

in which + and - are the direction indicator, and

s_num is the number of steps.

more elements like command tokens, field delimiters will be implemented later.
 

A command delimiter, e.g. carriage return will be required though.

Command decoding goes like this:
- receive the UART data to a buffer
- when command delimiter is received, convert the buffer content with atoi().
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top