You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
558 B
43 lines
558 B
#include "main.hpp"
|
|
#include "delay.h"
|
|
#include "stm32f0xx_csl.h"
|
|
#include "usart.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
uint8_t i = 0;
|
|
|
|
stmStart();
|
|
|
|
pinConfig(pinB3, output, pushPull, none, normal);
|
|
pinConfig(pinA0, input, pushPull, pullDown, normal);
|
|
|
|
usartInit();
|
|
|
|
print_Usart("Wellcome to our KED project\n\r");
|
|
|
|
for(i = 0 ; i < 10 ; i++)
|
|
{
|
|
delayMs(100);
|
|
pinToggle(pinB3);
|
|
delayMs(100);
|
|
}
|
|
|
|
pinWrite(pinB3,0);
|
|
|
|
while(1)
|
|
{
|
|
if(pinRead(pinA0))
|
|
{
|
|
pinWrite(pinB3,1);
|
|
}
|
|
else
|
|
{
|
|
pinWrite(pinB3,0);
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|