?? random.c
字號:
/******************************************************************************
Filename: random.c
Target: cc2430
Revised: 16/12-2005
Revision: 1.0
Description:
This application shows how to create a random sequence of bytes. The sequence
is displayed on the LCD and used to toggle the green and yellow LEDs.
******************************************************************************/
#include <string.h>
#include "RF04EB.h"
#include "app_ex.h"
#include "menu.h"
#include "lcd128_64.h"
#include "hal.h"
void initRandom(void);
void random_main(void);
/******************************************************************************
* @fn initRandom
*
* @brief
* Initializes the components for the random generator application example.
*
* Parameters:
*
* @param void
*
* @return void
*
******************************************************************************/
void initRandom(void)
{
DISABLE_ALL_INTERRUPTS();
halInitRandomGenerator();
INIT_RLED();
INIT_YLED();
}
/******************************************************************************
* @fn random_main
*
* @brief
* Main function.
*
* Parameters:
*
* @param void
*
* @return void
*
******************************************************************************/
#ifdef COMPLETE_APPLICATION
void random_main(void){
#else
void main(void){
#endif
UINT8 i, rand;
UINT8 arr[13] = {0};
TopDisp = 8;
initRandom();
ClearScreen();
Print(0,4,"--RANDOM TEST--",1);
Rectangle(15 , 3 , 113 , 5);
//read random register
for(i = 0; (i < 12); i++)
{
GET_RANDOM_BYTE(rand);
//SET_LED_MASK( rand );
// randChar is equal a random value between 'A' and 'Z'
// in the ascii table
arr[i] = 'A' + (rand % ('z' - 'a')) ;
Print6(4,28, arr,1);
Print6(7,31,"ESC TO EXIT",1);
halWait(0x0F);
}
while (K_CANCEL != ScanKey());
while(ScanKey() != 0Xff);
halWait(5);
YLED = LED_OFF;//GLED = LED_OFF
return;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -