Projet

Général

Profil

/***********************************************************************/
/* */
/* 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 t_clavier;

void main(void)
{
pd10=0xF0;
p10=0xFF;
pu30=1;
t=p10;
p10=0x00;

while(1)
{
t=p10;
if(t!=0x0F) // si une touche est appuy?
{
p10=0xEF; // test de la touche * et 7
t=p10;
if(t==0xE7)
{
t_clavier='*';
}
if(t==0xEB)
{
t_clavier='7';
}
p10=0xDF; // test de la touche 2, 5, 8, 0
t=p10;
if(t==0xDE)
{
t_clavier='2';
}
if(t==0xDD)
{
t_clavier='5';
}
if(t==0xDB)
{
t_clavier='8';
}
if(t==0xD7)
{
t_clavier='0';
}
p10=0x7F; // test de la touche 3, 6, 9, #
t=p10;
if(t==0x7E)
{
t_clavier='3';
}
if(t==0x7D)
{
t_clavier='6';
}
if(t==0x7B)
{
t_clavier='9';
}
if(t==0x77)
{
t_clavier='#';
}
p10=0xBF; // test de la touche 1, 4
t=p10;
if(t==0xBE)
{
t_clavier='1';
}
if(t==0xBD)
{
t_clavier='4';
}
}
}
}

(2-2/8)