首先对串口进行基本配置,异步时钟,11520兆赫兹的波特率,设置中断, 停止位1,不需要校验,: huart1.Instance=USART1; huart1.Init.BaudRate=115200; huart1.Init.WordLength=UART_WORDLENGTH_8B; huart1.Init.StopBits=UART_STOPBITS_1; huart1.Init.Parity=UART_PARITY_NONE; huart1.Init.Mode=UART_MODE_TX...
分享回复赞 单片机吧 堕落金刚V5 基于stc89c52的温度时钟显示,谁帮忙写个程序流程图,下面是程序void Ds18b20WriteByte(unsigned char dat){ unsignedint i, j; for(j=0;j<8; j++) { DSPORT = 0; //每写入一位数据之前先把总线拉低1us i++; DSPORT = dat & 0x01; //然后写入一个数据,从最低位开...
);}unsigned char Reset(void){unsigned char k;P2DIR |=BIT6;P2OUT &=~BIT6;delay(145);P2OUT |=BIT6 0755susan2018-07-05 09:01:06 新手提问:关于MSP430G2553的延时程序问题 GPIO_init();//IO初始化while(1){unsignedintk=100000;while(k0){k--;}P1OUT^=BIT0;P1OUT^=BIT6;}}voidGPIO_init...
void I2C_init(void); void I2C_start(void); void I2C_stop(void); unsigned char I2C_read(unsigned char ack_mode); void I2C_write(unsigned char value); Using hardware I2C requires us to manipulate the following registers apart from clock and GPIO settings. I2C GPIOs must be set as open-d...
voidsetup(void){Serial.begin(115200);/* MCP4725A0_address is 0x60 or 0x61 * MCP4725A0_IIC_Address0 -->0x60 * MCP4725A0_IIC_Address1 -->0x61 */DAC.init(MCP4725A0_IIC_Address0,REF_VOLTAGE);}voidloop(void){/*Output a magnitude of 2500mv, the frequency of 10HZ, DC offset 2500...