Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Calculator using PIC

Status
Not open for further replies.

MrNobody

New Member
Hey, I'm trying to do a simple calculator to add up 2 sets of numbers together using C18.
The number is entered using a keypad and displayed onto the LCD.

Lets say I want to calculate 101 + 50, I would first enter '1', '0', '1' using the keypad. The character '1', would then be stored in the first position of an array followed by '0' and then '1' in the 3rd position of the array. If I want to use the MCU's arithmetic function to add the numbers, i need to convert these characters in the array into 'int variable' of 101.

So, my question is how do I convert character '1', '0', '1' stored in the char array into int 101. Is there any built in function that enables me to do that apart from writting my own code..? Thanks.
 
Status
Not open for further replies.

Latest threads

Back
Top