[SOLVED] Mikroc pro keypad library proteus error

Status
Not open for further replies.

khatus

Member level 3
Joined
Oct 7, 2017
Messages
60
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
448
 

You have a strange programming structure, why not change:
Code:
    case 1: pulsador = 55; return pulsador; break;  // 7
to
Code:
    case 1: return '7';  break;  // 7
or better still, use a short lookup table.

However, the timing of the errors suggests your loop is running continuously, regardless of whether a key is actually pressed so you are passing values to the LCD faster than it can process them. You need to look at the keypad routine and maybe check for a default value if no key is pressed or for it to wait until one is pressed.

I strongly advise against returning the same variable 'pulsador' from a routine as you pass to it. It isn't technically incorrect but will cause confusion in the future. You change the value in the switch statement while it is running which again isn't good practice.

Brian.
 

Thanks problem solved. I have write the code for 8Mhz oscillator and simulate it in proteus in 20Mhz
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…