894 Kişi Okudu
#define button GPIOf_ODR.B5
unsigned okunan, yaz;
void main()
{
GPIO_Digital_output(&GPIOc_ODR, _GPIO_PINMASK_1| _GPIO_PINMASK_2) ;
GPIO_Digital_Input(&GPIOF_IDR, _GPIO_PINMASK_5);
GPIO_Digital_Input(&GPIOA_IDR, _GPIO_PINMASK_0);
UART2_Init(9600); // initialize UART2 module
Delay_ms(100);
UART_Set_Active(UART2_Read, UART2_Write, UART2_Data_Ready,UART2_Tx_Idle ); // Uart modüllerini aktive ediyor...
UART2_Write_Text("Bismillah"); //ilk olarak gönderilen yazı
delay_ms(100);
UART2_Write(13); //başlangıç biti
UART2_Write(10); // bitiş biti
While (1)
{
if(GPIOA_IDR.B0 == 1) {
UART2_Write_text("Ahmet");
UART2_Write(13);
UART2_Write(10);
delay_ms(100);
}
delay_ms(55);
if(GPIOF_IDR.B5 == 1) {
UART2_Write_text("yasin");
UART2_Write(13);
UART2_Write(10);
delay_ms(100);
}
}
}