?? demonstrator.c
字號:
// Demonstrator.c Messenger version
#include "PC_Comm.h"
#include "Messages.h"
void initializer()
{
// Calibrate the oscillator:
OSCCAL_calibration();
// Initialize the USART
USARTinit();
// Display instructions on PC
sendFString(TALKING_TO);
sendFString(WHO_DEMO);
char c = '0';
for(int i = 0; i < 5; i++)
{
sendFString(ENTER);
sendChar(c + i);
sendFString(FOR);
sendFString(ERROR_TBL[i]);
}
}
void parseInput(char s[])
{
if( (s[0] <= '4') && ( s[0] >= '0') ) // 5 error messages
{
showMessage(s[0]);
}
else
{
// parse first character
switch (s[0])
{
case 'd':
if( (s[1] == 'e') && (s[2] == 'm') && (s[3] == 'o') && (s[4] == '?') )
sendFString(TALKING_TO);
sendFString(WHO_DEMO);
break;
default:
sendFString(BAD_COMMAND1);
sendChar(s[0]);
sendFString(BAD_COMMAND2);
break;
}
s[0] = '\0';
}
}
void showMessage(char mess)
{
int num = atoi(&mess);
sendFString(ERROR_TBL[num]); // Send the song title to the PC
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -