Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ========================================
- *
- * Copyright YOUR COMPANY, THE YEAR
- * All Rights Reserved
- * UNPUBLISHED, LICENSED SOFTWARE.
- *
- * CONFIDENTIAL AND PROPRIETARY INFORMATION
- * WHICH IS THE PROPERTY OF your company.
- *
- * ========================================
- */
- #include "project.h"
- #include "keyboard_keyboard.h"
- int COUNT=0;
- void button(){
- if (SW1_Read()){
- LCD_ClearDisplay();
- LCD_Position(0,1);
- LED1_Write(1);
- CyDelay(500);
- COUNT += 1;
- LED1_Write(0);
- LCD_PrintNumber(COUNT);
- }
- }
- void key(){
- keyboard_Start();
- if (keyboard_Scan()==49){
- LCD_ClearDisplay();
- LCD_PrintNumber(1);
- CyDelay(50);
- LCD_ClearDisplay();
- }
- }
- void toggle()
- {
- GPIOJ11_Write(1);
- CyDelay(500);
- GPIOJ11_Write(0);
- CyDelay(50);
- GPIOJ12_Write(1);
- CyDelay(500);
- GPIOJ12_Write(0);
- CyDelay(500);
- }
- int main(void)
- {
- CyGlobalIntEnable; /* Enable global interrupts. */
- LCD_Init();
- LCD_ClearDisplay();
- LCD_Position(0,1);
- /* Place your initialization/startup code here (e.g. MyInst_Start()) */
- for(;;)
- {
- /* Place your application code here. */
- // button();
- // key();
- toggle();
- }
- }
- /* [] END OF FILE */
Advertisement
Add Comment
Please, Sign In to add comment