我正在为我的学校项目编写一个Max72xx库,我找到了一种使用数据表附带的寄存器设置列的方法.现在,我也找到了一种设定高度的方法.所以我创建了一个带有两个参数的函数:row基本上将x轴发送到芯片,以及设置y轴的高度.
我在这段代码中所做的基本上如下:
const uint8_t& row)uint8_t height)我想实现以下目标:
height设置为3:应创建以下位模式:1110 000.或者,如果用户使用8,我希望创建该功能1111 1111.或者如果用户将5设置为y轴,我希望fucntin创建一个位模式1111 1000,等等.我提供的代码如下(这段代码在函数setColumn中):
if (height >= 1 && height <= 8) { // if the height is between the matrix range
uint8_t pattern = 0x00; // create a pattern to send to the chip
uint8_t counter = 0; // counter for counting the zeros to shift left later on
for (uint8_t i = 0; i < …Run Code Online (Sandbox Code Playgroud)