if(Display_Count>=80 && Display_Flag == 0) { Display_Flag = 1; send_LED_Display(0xC0,g_sht2x_param.TEMP_HM,1); }
时间: 2023-05-20 10:07:46 浏览: 66
&& Display_Count<=100) 的意思是什么?
这段代码是在判断 Display_Count 是否在 80~100 之间的范围内,如果是,则执行后面的代码逻辑。符号 >= 是大于等于,符号 <= 是小于等于。
相关问题
// 显示输入的密码if (delete_count == 2'b00 && password_count > 0) begin // 将输入的密码存储到display寄存器中 display <= {input_password,4'b0000}[(count4)+3:(count4)]; count <= count + 2'b01; last_password_count <= password_count;end else if (delete_count == 2'b01 && last_password_count > 0) begin // 删除输入的密码 display <= display-4'b0001; count <= count - 2'b01; last_password_count <= last_password_count - 1;end; // 加入分号 Error (10170): Verilog HDL syntax error at keshe9.v(60) near text "["; expecting ";"这个错误改完之后的代码
如果你想在Verilog中使用花括号来创建一个选择器,你需要在使用选择器前加上一个反斜杠,如下所示:
```
// 显示输入的密码
if (delete_count == 2'b00 && password_count > 0) begin
// 将输入的密码存储到display寄存器中
display <= {input_password,4'b0000}[((count4)+3):(count4)];
count <= count + 2'b01;
last_password_count <= password_count;
end else if (delete_count == 2'b01 && last_password_count > 0) begin
// 删除输入的密码
display <= display-4'b0001;
count <= count - 2'b01;
last_password_count <= last_password_count - 1;
end;
```
这样,Verilog就会将花括号视为选择器,而不是一个新的语法结构。
// 显示输入的密码 if (delete_count == 2'b00 && password_count > 0) begin // 将输入的密码存储到display寄存器中 display <= {input_password,4'b0000}[(count4)+3:(count4)]; count <= count + 2'b01;last_password_count <= password_count; end else if (delete_count == 2'b01 && last_password_count > 0) begin // 删除输入的密码 display <= display-4'b0001; count <= count - 2'b01; last_password_count <= last_password_count - 1; end;// Error (10170): Verilog HDL syntax error at keshe9.v(60) near text "["; expecting ";"还是这个错误改了之后的代码是什么
你需要在 `display` 寄存器的赋值语句中加入一个分号,代码如下所示:
```
// 显示输入的密码
if (delete_count == 2'b00 && password_count > 0) begin
// 将输入的密码存储到display寄存器中
display <= {input_password,4'b0000}[(count4)+3:(count4)];
count <= count + 2'b01;
last_password_count <= password_count;
end else if (delete_count == 2'b01 && last_password_count > 0) begin
// 删除输入的密码
display <= display-4'b0001;
count <= count - 2'b01;
last_password_count <= last_password_count - 1;
end; // 加入分号
```
这样就可以解决 Verilog HDL syntax error at keshe9.v(60) near text "["; expecting ";" 的问题了。