-
-
... clock enable for deboucing (4Hz)
process(clk)
begin
if(rising_edge(clk)) then
counter_slow <= counter_slow + x"0000001";
--if(counter_slow>=x"17D7840") then -- for running on FPGA -- comment when running simulation
if(counter_slo...
-
-
...rtex(int v)
{
//判断是否还有空位置
if(numVertices==maxVertices)
return false;
VerticesList[numVertices]=v;
++numVertices;
}
//给出顶点在顶点表中的下标
int NetTopo::getVertexPos(int v)
...
-
-
... TL0 = (65536 - 2000) % 256; //TL0重置函数
cp1++;
if(cp1 >= 250) //0.5秒
{
cp1 = 0;
flash = ~flash; //产生闪烁变量
cp2++;
if(cp2 >= 5)
{
cp2 = 0;
conv = ~conv; //产生交替显示变量 ...
-
-
...****/
void EXINT0(void)interrupt 0 using 1
{
EX0=0; //关中断
if(Add_Button==0) //时间加
{
EW1+=5;
SN1+=5;
if(EW1&...
-
-
... cout << s[i]; if((l-1-i)%3==0&&(l-1-i)!=0&&s[i]!='-') cout << ','; } return 0;}#include<iostream>#include<iomanip>using namespace std;int main(){ doubl...
-
-
... b=l(i,3); for j=1:no if a==j C(i,j)=-1; end if b==j C(i,j)=1; end ende...
-
-
...;
LM=1;//左右两个电机同时启动,直线前进
while(1)
{
if((R==1)&&(M==1)&&(L==0))//小车右偏
{
RM=1;
LM=0;//左边的电机停止转动,右边的电机转动,这样就实现了左转
}
if((R==0)&&(M==1)&&(L==1))//小...
-
-
...TL) //将温度上下限转换为LCD显示的数据
{
if(TH>0x7F) //判断正负,如果为负温,将其转化为其绝对值
{
TempBuffer0[3]=0x2d; //0x2d为"...
-
-
...1,1) for j=1:sizl(1,1) if (i~=j)&&(ldata(i,2)==ldata(j,1)) co=co+1; end end if co==0 in=i...
-
-
....nextInt(); int result = 0; N = 1024 - N; if (N >= 64) { result += N / 64; N %= 64; } if (N >= 16) { result += N / 16; N %= 16; } if (N >= 4) {&nb...