2266 views|1 replies

13

Posts

0

Resources
The OP
 

Control the state of multiple IOs through the serial port [Copy link]

Purpose of code: There are 50 IO ports to be controlled, all of which are high level in static state. Now you need to use the serial port to control the IO ports to be pulled low. You can select any of the 50 ports to be pulled low. For example, if the serial port sends a 50-bit data, where the 20th, 25th, and 30th bits are 0 and the rest are 1, it means that the corresponding three IO ports are low level and return to high level after a delay, and the rest remain unchanged. For example:
if((USART_RX_BUF[0]-'0') == 0)
{
LED0 = 0;
delay_ms(500);
LED0 = 1;
}

This post is from stm32/stm8

Latest reply

Not difficult. Are the 50 IOs an extension? Or is it the controller itself?  Details Published on 2019-10-7 12:24
 

15

Posts

0

Resources
2
 
Not difficult. Are the 50 IOs an extension? Or is it the controller itself?
This post is from stm32/stm8
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list