新手入门
- 积分
- 17
- 金钱
- 17
- 注册时间
- 2016-8-1
- 在线时间
- 2 小时
|
1金钱
int main(void)
{
Stm32_Clock_Init(5);
delay_init(1);
LED_Init();
while(1)
{
q4to1(m0);q4to1(m1);q4to1(m2);q4to1(m3);
}
}
void q4to1(int a)
{
int temp;
temp=a;
if(temp==0){ling();}
if(temp==1){yi();}
if(temp==2){er();}
if(temp==3){san();}
}
void test1(int b)
{ int a;
b=a;
m0=a%4;
a=a/4;
m1=a%4;
a=a/4;
m2=a%4;
a=a/4;
m3=a%4;
}
函数可以看出 ,我把一个十进制数变成4进制数,然后一个一个执行主函数,但是现在是先判断m0然后传送,再判断m1然后传送, 有没有什么方法把所有的m0 m1 m2 m3,判断完一次性传送?
ling yi er san 是我写的子函数 这里就不贴了
|
|