头像-8428

力洪

  • 四川省泸州市
  • 单片机
  • 设计,制造及服务

个人成就

获得 2 次赞

帮助过252人

内狗为什么会偷偷出来咬人?

明明关了不用的,可是有时候就是给我的系统复位了,为什么,有人遇到过吗?

msp430 1602显示

#include "msp430g2553.h" void delay(int i) { unsigned int a,b; for(a=i;a>0;a--)         for(b=1111;b>0;b--); } void busy() {         unsigned char BF;         P2OUT |=BIT1;         P2OUT &=~BIT2;         P2OUT &=~BIT0;         BF=(P1IN&BIT7);         P2OUT |=BIT0;         delay(5);         P2OUT &=~BIT0;     if(BF==1)     {     delay(100);     }     delay(100); } void write_com (unsigned char com) {         P2OUT &=~BIT1;         P2OUT &= ~BIT2;         P2OUT &=~BIT0;         P1OUT =com;     delay(100);         P2OUT |=BIT0;         P2OUT &=~BIT0; } void write_date(unsigned char date) {         P2OUT &=~BIT1;         P2OUT |=BIT2;         P2OUT &=~BIT0;         P1OUT =date;         delay(100);         P2OUT |=BIT0;         P2OUT &=~BIT0; } void inti() {         write_com(0x38);         write_com(0x0c);         write_com(0x06);         write_com(0x01);         write_com(0x80);         delay(5); } void main(void) {         P1DIR |=0xff;         P2DIR |=0xff;         P1SEL =0;         P2SEL =0;   inti();    busy();    write_date(0x41);    busy();    write_com(0xc0);    busy();    write_date(0x42);    while(1); } 求大神指教      显示一直闪烁