CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Making a calculator in proteus and ccs

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
enyam.agbodjavou



Joined: 29 Mar 2016
Posts: 1

View user's profile Send private message

Making a calculator in proteus and ccs
PostPosted: Tue Mar 29, 2016 5:25 am     Reply with quote

hi people,
I am making a simple calculator. I am not using the keypad but the buttons.
The code below is how I take input from the buttons,
num1 is an array of 4.

if(input(PIN_C1)==1)
{
if(press==0)
{
printf(lcd_putc,"\f");
}
printf(lcd_putc,"8");
Delay_ms(500);
press=press+1;
num1[press=press+1]=8;
}

I did the same for all the other numbers. but when I enter 45+2 for example, it only takes the first digit and add it to the 2 so it will do 4 + 2 and the answer will be 6 instead of 46!
Please help
temtronic



Joined: 01 Jul 2010
Posts: 9177
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 29, 2016 5:34 am     Reply with quote

as you're a first time poster.....
some comments..
1) Please read top sticky called PIC101.
2) Proteus is busted, can't be fixed, no one here can be bothered with it.
3) Post a COMPLETE program, using the 'code[]' button. We must know PIC type, compiler version, etc. to properly help you
4) Confirm you are using real hardware. There is a HUGE difference to what Proteus allows versus the Real World.


Jay
signorenza



Joined: 30 Mar 2016
Posts: 1

View user's profile Send private message

The key to a sucessful PIC design-is to follow data sheet
PostPosted: Wed Mar 30, 2016 4:52 am     Reply with quote

u need to download my sample c code --here--
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Wed Mar 30, 2016 5:34 pm     Reply with quote

Gee - that sounds like an invitation too good to be true Rolling Eyes
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group