This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我不熟悉微控制器编程、我尝试在 for 循环中与某些输入 GPIO 进行交互、但我不知道该怎么做。
# define rows 4 int input_pin[rows]={GpioDataRegs.GPADD.bit.GPIO1、GpioDataRegs.GPADD.bit.GPIO2、GpioDataRegs.GPADD.bit.GPIO3、GpioDataRegs.DP.bit.GPIO4};GPr ; 对于(r = 0;r < rows;r++) { 如果(&INPUT_PIN[r]=0) 执行一些操作 ;}
我正在尝试一个具有如下定义的代码(这不是所有项目、BTW) 、但给出错误" identifier input_pins is undefined 且必须有一个常量值"。我认为 input_pin 应该是一个易失性结构、但我不确定它是如何实现的、 我只是想在 for 循环或类似的任何循环中作出反应、请提供任何建议、谢谢您的参与
[引用 user="Juan Esteban Hernandez Alvarez"]但请提供错误" identifier input_pins is undefined and must have a constant value)代码片段中的数组变量名为 input_pin、而不是 input_pins
尊敬的 Juan:
代码片段中使用的数组变量(input_pin 和 input_pins)不匹配、这会导致编译错误。
此外、您还可以尝试运行 C2000Ware 中提供的"led_ex1_blinky"示例以熟悉 GPIO 切换。
此致
Siddharth