forked from trocache/RefKEIL
Ajout du bouton et de la led fonctionnant ensemble.
This commit is contained in:
parent
2e86eb6f77
commit
402fdcfe4e
2 changed files with 10 additions and 22 deletions
|
@ -4,13 +4,17 @@
|
|||
int main ( void )
|
||||
{
|
||||
int returnValue;
|
||||
MyGPIO_Struct_TypeDef gpioA5_test = {GPIOA,5,Out_PullUp};
|
||||
MyGPIO_Init(&gpioA5_test);
|
||||
MyGPIO_Set(GPIOA,5);
|
||||
MyGPIO_Toggle(GPIOA,5);
|
||||
MyGPIO_Toggle(GPIOA,5);
|
||||
MyGPIO_Reset(GPIOA,5);
|
||||
MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp}; //led
|
||||
MyGPIO_Struct_TypeDef bouton = {GPIOC,13,In_PullDown}; //bouton poussoir
|
||||
MyGPIO_Init(&led);
|
||||
MyGPIO_Init(&bouton);
|
||||
do{
|
||||
if(MyGPIO_Read(GPIOC,13))
|
||||
{
|
||||
MyGPIO_Reset(GPIOA,5);
|
||||
} else {
|
||||
MyGPIO_Set(GPIOA,5);
|
||||
}
|
||||
}while(1) ;
|
||||
|
||||
}
|
||||
|
|
|
@ -414,22 +414,6 @@
|
|||
<Bp>
|
||||
<Number>0</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>10</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134218772</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\Source\Principale.c</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\cool_reel\Source/Principale.c\10</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>1</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>6</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>0</Address>
|
||||
|
|
Loading…
Reference in a new issue