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

📄 main.c

📁 Freescale Code Warrior中C的编程
💻 C
字号:
#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */


void MCU_init(void); /* Device initialization function declaration */

void main(void) {
  /* include your code here */
 /*
  0.0000000000
    ||||||||||___________    0.0009765625
    |||||||||____________    0.001953125
    ||||||||_____________    0.00390625
    |||||||______________    0.0078125
    ||||||_______________    0.015625
    |||||________________    0.03125
    ||||_________________    0.06125
    |||__________________    0.125
    ||___________________    0.25
    |____________________    0.5   */
    

  /* Uncomment this function call after using Device Initialization
     to use the generated code */
  /* MCU_init(); */
  unsigned int A,B;
  
  A = 0xB32F;
  
  EnableInterrupts; /* enable interrupts */

    
  //0.378 = 0.25 + 0.125 + 0.001953125
  
  // what about 3.1416? or
  // what about 0.672?
  
  for(;;) {
  
    // B = 0.378 * A
    
    B = (A>>2)+(A>>3)+(A>>9);

    __RESET_WATCHDOG(); /* feeds the dog */
  } /* loop forever */
  /* please make sure that you never leave this function */
}

⌨️ 快捷键说明

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