⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 led.c

📁 用单片机实现的总线比较的2取2功能的安全计算机
💻 C
字号:
#include <pic.h>
#include <math.h>

#define	PORTBIT(adr, bit) ((unsigned)(&adr)*8+(bit))

volatile bit button @ PORTBIT(PORTB, 1);

const char Msg[] = {"This is a string\0"};

int sub1(int i, int j)
{
  int ii, jj;

  ii = i;
  jj = j;
}

void main()
{
  int arr[10];
  int i, j;

  float r;

  j = 0;
  for (i=0; i!=10; i++) {
    j += i;
    arr[i] = j;
  }

  r = 3.14159;
  r = sin(r/2);

#asm
  movlw  10
  movwf  30
#endasm

  TRISB = 0;		/* all bits output */
  for(;;) {
    PORTB = 0x00;		/* turn all on */
    for (i = 100 ; --i !=0;);
    PORTB = ~j;		/* output value of j */
    for(i = 100 ; --i ;);
    if (button=1) j++;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -