×

使用Galileo II和ANSI C驱动MCP23017 IO扩展器16个通用输出

消耗积分:0 | 格式:zip | 大小:0.24 MB | 2022-10-21

訾存贵

分享资料个

描述

使用 Galileo II 和 ANSI C,演示如何驱动 MCP23017 IO 扩展器 16 个通用输出,它们本身驱动四个 74HC4511 七段显示驱动器。

The 74HC4511 accepts as inputs a 4 bit binary encoded decimal value. This value is interpreted as a single digit, and the 74HC4511 converts this value to provide output to the seven individual segments to display the digit.

The C code demonstrates how to interact with the MCP23017 using the MRAA I2C interface. This interaction is composed of two bytes, with each byte driving the two general purpose IO groups. Each byte is composed of eight bits - two four bit groups. Each four bit group represents a digit to the 74HC4511.

C 代码进一步演示了结构的使用 - 包含四个数字值,并且对于每个数字值,都有一个标志,指示是启用特定的七段显示,还是将其全部清空。该代码进一步展示了 C 位运算符的强大功能以及操作位的简单性。最后,对于新的 C 编码器,干净的代码演示在函数调用中使用显式值,并避免使用全局变量。

代码执行前的项目初始状态
 

 

 

 


声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !