mirror of
https://git.etud.insa-toulouse.fr/boujon/voilier-team-1.git
synced 2025-06-08 16:00:49 +02:00
Remote now uses the motor, creation of initImplementation
This commit is contained in:
parent
5f5fa1a099
commit
381f0b6147
4 changed files with 54 additions and 28 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "remote.h"
|
||||
#include "gpio.h"
|
||||
#include "motoreducteur.h"
|
||||
|
||||
MyUART_Struct_Typedef uartCool = {USART1,9600,lengthBit8,parityNone,stopBit1};
|
||||
|
||||
|
@ -7,12 +8,14 @@ void remote(uint8_t data)
|
|||
{
|
||||
MyUART_Send(&uartCool,data);
|
||||
int8_t signedData = (int8_t)data;
|
||||
if(signedData > 0)
|
||||
if(signedData >= 0)
|
||||
{
|
||||
MyGPIO_Set(GPIOA,5);
|
||||
MyMotor_ChangeDirection(HORAIRE);
|
||||
MyMotor_ChangeSpeed(signedData*100);
|
||||
}
|
||||
else {
|
||||
MyGPIO_Reset(GPIOA,5);
|
||||
MyMotor_ChangeDirection(ANTIHOR);
|
||||
MyMotor_ChangeSpeed((-signedData)*100);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,21 +5,25 @@
|
|||
#include "rtc.h"
|
||||
#include "remote.h"
|
||||
|
||||
void initImplementation(void);
|
||||
|
||||
int main (void)
|
||||
{
|
||||
//MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp}; //led
|
||||
//MyGPIO_Init(&led); //test des leds pour ignorer les contraintes liées aux différents ports
|
||||
initImplementation();
|
||||
//MyRTC_GetTime(&sec, &min, &hour, &day, &date, &month, &year);
|
||||
while(1){};
|
||||
}
|
||||
|
||||
void initImplementation(void)
|
||||
{
|
||||
MyServo_Init();
|
||||
MyServo_ChangeAngle(179);
|
||||
MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp}; //led
|
||||
MyGPIO_Init(&led); //test des leds pour ignorer les contraintes liées aux différents ports
|
||||
//MyMotor_Init();
|
||||
|
||||
//MyMotor_ChangeSpeed(2000);
|
||||
//MyMotor_ChangeDirection(HORAIRE);
|
||||
initRemote();
|
||||
testRemote();
|
||||
|
||||
MyMotor_Init();
|
||||
MyMotor_ChangeSpeed(0);
|
||||
MyMotor_ChangeDirection(HORAIRE);
|
||||
MyRTC_Init();
|
||||
// MyRTC_GetTime();
|
||||
|
||||
while(1){};
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
@ -183,10 +183,10 @@
|
|||
<TargetOption>
|
||||
<CLKADS>12000000</CLKADS>
|
||||
<OPTTT>
|
||||
<gFlags>0</gFlags>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>1</RunSim>
|
||||
<RunTarget>0</RunTarget>
|
||||
<RunSim>0</RunSim>
|
||||
<RunTarget>1</RunTarget>
|
||||
<RunAbUc>0</RunAbUc>
|
||||
</OPTTT>
|
||||
<OPTHX>
|
||||
|
@ -228,14 +228,14 @@
|
|||
<LExpSel>0</LExpSel>
|
||||
</OPTXL>
|
||||
<OPTFL>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
<uSim>1</uSim>
|
||||
<uTrg>0</uTrg>
|
||||
<uSim>0</uSim>
|
||||
<uTrg>1</uTrg>
|
||||
<sLdApp>1</sLdApp>
|
||||
<sGomain>1</sGomain>
|
||||
<sRbreak>1</sRbreak>
|
||||
|
@ -244,7 +244,7 @@
|
|||
<sRfunc>1</sRfunc>
|
||||
<sRbox>1</sRbox>
|
||||
<tLdApp>1</tLdApp>
|
||||
<tGomain>0</tGomain>
|
||||
<tGomain>1</tGomain>
|
||||
<tRbreak>1</tRbreak>
|
||||
<tRwatch>1</tRwatch>
|
||||
<tRmem>1</tRmem>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<bEvRecOn>1</bEvRecOn>
|
||||
<bSchkAxf>0</bSchkAxf>
|
||||
<bTchkAxf>0</bTchkAxf>
|
||||
<nTsel>-1</nTsel>
|
||||
<nTsel>6</nTsel>
|
||||
<sDll></sDll>
|
||||
<sDllPa></sDllPa>
|
||||
<sDlgDll></sDlgDll>
|
||||
|
@ -269,8 +269,20 @@
|
|||
<tDlgDll></tDlgDll>
|
||||
<tDlgPa></tDlgPa>
|
||||
<tIfile></tIfile>
|
||||
<pMon></pMon>
|
||||
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
|
||||
</DebugOpt>
|
||||
<TargetDriverDllRegistry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>ST-LINKIII-KEIL_SWO</Key>
|
||||
<Name>-U066FFF504955857567155843 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(1BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>UL2CM3</Key>
|
||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM))</Name>
|
||||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
|
@ -314,6 +326,13 @@
|
|||
<pszMrulep></pszMrulep>
|
||||
<pSingCmdsp></pSingCmdsp>
|
||||
<pMultCmdsp></pMultCmdsp>
|
||||
<DebugDescription>
|
||||
<Enable>1</Enable>
|
||||
<EnableFlashSeq>0</EnableFlashSeq>
|
||||
<EnableLog>0</EnableLog>
|
||||
<Protocol>2</Protocol>
|
||||
<DbgClock>10000000</DbgClock>
|
||||
</DebugDescription>
|
||||
</TargetOption>
|
||||
</Target>
|
||||
|
||||
|
@ -359,7 +378,7 @@
|
|||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>3</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\driver\gpio.c</PathWithFileName>
|
||||
|
@ -439,7 +458,7 @@
|
|||
<GroupNumber>3</GroupNumber>
|
||||
<FileNumber>9</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>..\implementation\rtc.c</PathWithFileName>
|
||||
|
|
|
@ -581,11 +581,11 @@
|
|||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>-1</DriverSelection>
|
||||
<DriverSelection>4096</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3></Flash3>
|
||||
<Flash3>"" ()</Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
|
|
Loading…
Add table
Reference in a new issue