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.

[General] How to convert string to decimal in pic controller using UART. If i press 9999 controls

Status
Not open for further replies.

ahshiq

Newbie level 4
Joined
Aug 27, 2015
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
58
how to convert string to decimal in pic controller using UART. if i press 9999 contro

how to convert string to decimal in pic controller using UART. if i press 9999 controller takes its ascii value. but i need to display 9999 in 7 segment LED, i am using hi-tech complier,
 

pic.programmer

Advanced Member level 3
Joined
Aug 19, 2015
Messages
773
Helped
141
Reputation
284
Reaction score
140
Trophy points
43
Activity points
7,542
Re: how to convert string to decimal in pic controller using UART. if i press 9999 co

Use atoi() or atol() functions to convert string to integer. If it is float then use atof() function. Then you can extract digits and use mask for 7 Segment display.
 

Easyrider83

Advanced Member level 5
Joined
Oct 11, 2011
Messages
1,608
Helped
373
Reputation
746
Reaction score
361
Trophy points
1,363
Location
Tallinn, Estonia
Activity points
8,577
Re: how to convert string to decimal in pic controller using UART. if i press 9999 co

Just substract 0x30 (48) from each char in input buffer.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top