?? irrecv.c
字號:
//****************************************************************************
//
// IRRECV.C - Prints characters received via the IR port on the LCD panel.
//
// Copyright (c) 1998-2001 Cirrus Logic, Inc.
//
//****************************************************************************
#include "lib7312.h"
#include <stdio.h>
//****************************************************************************
//
// This program receives characters from the IR port and displays them on the
// LCD panel. When a '-' character is received, the program exits (but the
// '-' character is not displayed).
//
//****************************************************************************
void
entry(void)
{
int iX = 0, iY = 0;
char cChar;
CPixel sColor;
//
// Enable the LCD controller, clear the frame buffer, and turn on the LCD
// panel.
//
LCDColorEnable();
LCDColorCls();
LCDColorOn();
LCDColorBacklightOn();
LCDColorContrastEnable();
//
// Enable the IR port at 9600 baud.
//
IREnable(9600);
//
// Set the pixel color to white
//
sColor.r = 15;
sColor.g = 15;
sColor.b = 15;
//
// Read characters from the IR port until we receive a '-' character.
//
while((cChar = IRReceiveChar()) != '-')
{
//
// Print the character which we received.
//
LCDColorPrintChar(cChar, iX, iY, sColor);
//
// Advance the cursor to the next column.
//
iX += 8;
//
// If we've just stepped past the right column, then skip down to the
// next line.
//
if(iX == 320)
{
//
// Adjust the cursor to the beginning of the next line.
//
iX = 0;
iY += 8;
//
// If we've just stepped below the last line, then move back to the
// first line.
//
if(iY == 240)
{
//
// Move the cursor to the first line.
//
iY = 0;
}
}
}
//
// Disable the IR port.
//
IRDisable();
//
// Turn off the LCD panel.
//
LCDColorContrastDisable();
LCDColorBacklightOff();
LCDColorOff();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -