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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…