|
/***********************************************************************/
|
|
/* */
|
|
/* FILE :SP4b1.c */
|
|
/* DATE :Wed, May 26, 2021 */
|
|
/* DESCRIPTION :main program file. */
|
|
/* CPU GROUP :87B */
|
|
/* */
|
|
/* This file is generated by Renesas Project Generator (Ver.4.18). */
|
|
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
|
|
/***********************************************************************/
|
|
#include "sfr32c87.h"
|
|
|
|
char t;
|
|
char touche;
|
|
|
|
void main(void)
|
|
{
|
|
|
|
pd10 = 0xF0; //F:sortie, 0:Entree
|
|
p10 = 0xFF;
|
|
pu30 = 1;
|
|
t = p10;
|
|
p10 = 0x00;
|
|
|
|
while (1)
|
|
{
|
|
t = p10;
|
|
if (t != 0x0F) //une touche est apuyee
|
|
{
|
|
p10=0xEF; // colonne de droite a 0
|
|
t=p10;
|
|
if (t == 0xEB) //la touche 7 est apuyee
|
|
{
|
|
touche='7';
|
|
}
|
|
if (t == 0xE7) //la touche * est apuyee
|
|
{
|
|
touche='*';
|
|
}
|
|
|
|
p10=0x7F; // colonne du milieu a 0
|
|
t=p10;
|
|
if (t == 0x7E) //la touche 3 est apuyee
|
|
{
|
|
touche='3';
|
|
}
|
|
if (t == 0x7D) //la touche 6 est apuyee
|
|
{
|
|
touche='6';
|
|
}
|
|
if (t == 0x7B) //la touche 9 est apuyee
|
|
{
|
|
touche='9';
|
|
}
|
|
if (t == 0x77) //la touche # est apuyee
|
|
{
|
|
touche='#';
|
|
}
|
|
|
|
p10=0xDF; // colonne du milieu a 0
|
|
t=p10;
|
|
if (t == 0xDE) //la touche 2 est apuyee
|
|
{
|
|
touche='2';
|
|
}
|
|
if (t == 0xDD) //la touche 5 est apuyee
|
|
{
|
|
touche='5';
|
|
}
|
|
if (t == 0xDB) //la touche 8 est apuyee
|
|
{
|
|
touche='8';
|
|
}
|
|
if (t == 0xD7) //la touche 0 est apuyee
|
|
{
|
|
touche='0';
|
|
}
|
|
|
|
p10=0xBF; // colonne de gauche a 0
|
|
t=p10;
|
|
if (t == 0xBE) //la touche 1 est apuyee
|
|
{
|
|
touche='1';
|
|
}
|
|
if (t == 0xBD) //une touche 4 est apuyee
|
|
{
|
|
touche='4';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|