/*****************pms150g按键**********************/
/*****************qq:774145445*********************/
/*****************快手:共同学习stm8****************/
/*****************ide:0.92b2_20220218**************/
/**************************************************/
// pms150g
// ______ ______
// 3.3v-|1-vdd \_/ gnd-8|-gnd
// -|2-pa7 pa0-7|-
// -|3-pa6 pa4-6|-led
// -|4-pa5_____pa3-5|-anjian
#include "extern.h"
led bit pa.4;
anjian bit pa.3;
void FPPA0 (void)
{
.ADJUST_IC SYSCLK=IHRC/4 // SYSCLK=IHRC/4
$ led out;
$ anjian in,pull;
word a1;
while (1)
{
if(anjian==0)
{
if(led==0){led=1;}else{led=0;}
a1=0;
while(anjian==0)
{
a1++;
if(a1>5){break;}
.delay 10000;
}
}
.delay 4000;
}
}
|