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.

C18 Problem

Status
Not open for further replies.

Diego Rueda

New Member
Hi,

I need hek with a C18 code that i'm writing now. well i need to create one calculator with a 4x4 matricial keyboard, four 7 Segement displays and one microcontroller 18f4550. The problem occurs when i do an oparation using 2 operators and save the result in one variable tha was declared as unsigned char. After that i nedd see this result in the four displays but the problem is that im using an array named digitos and each position of this array shows that number in each display. I don't know how to charge this variable on the array taking each character and showing it.

thanks
 
Firstly... an unsigned char will give you a max result of 255. You would be better off with an unsigned int.

Secondly.. simple maths will get the result into the array. Then you need a lookup table to identify which bits light each segment on the display.

If you look at my signature at the bottom of my post, you'll see two links.. One is Nigels tutorials in ASM where you will find a schematic using 7 segment display's, and one is mine, using C to run on Nigels tutorial boards..
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top