mirror of
https://git.etud.insa-toulouse.fr/boujon/voilier-team-1.git
synced 2025-06-08 07:50:49 +02:00
Controle Voile et Debug PWM channel
This commit is contained in:
parent
8793ad9d28
commit
18e312d6c5
4 changed files with 17 additions and 8 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
void MyGirouette_Init(TIM_TypeDef *TIMX)
|
||||
{
|
||||
|
||||
RCC->APB1ENR |=RCC_APB1ENR_TIM4EN;
|
||||
//configuration gpiob6 et gpiob7 en entrées In_Floating imposer par le timer4
|
||||
MyGPIO_Struct_TypeDef MyGPIO={GPIOB,6,In_Floating};
|
||||
MyGPIO_Init(&MyGPIO);
|
||||
|
|
|
@ -13,8 +13,8 @@ void MyServo_Init(void)
|
|||
MyTimer_Base_Init(&Timer);
|
||||
|
||||
//Pin Timer 2 Channel 1 PA0
|
||||
MyTimer_PWM(TIM2, 1);
|
||||
MyTimer_DutyCycle(TIM2, 1, 750);
|
||||
MyTimer_PWM(TIM2, 2);
|
||||
MyTimer_DutyCycle(TIM2, 2, 750);
|
||||
|
||||
MyTimer_Base_Start(Timer);
|
||||
}
|
||||
|
@ -26,5 +26,5 @@ void MyServo_ChangeAngle(uint8_t Angle)
|
|||
|
||||
int DC = 500 + (Angle * 500 / 180);
|
||||
|
||||
MyTimer_DutyCycle(TIM2, 1, DC);
|
||||
MyTimer_DutyCycle(TIM2, 2, DC);
|
||||
}
|
||||
|
|
|
@ -27,9 +27,13 @@ int main (void)
|
|||
while(1){
|
||||
Lecture_accelerometre(&GX,&GY,&GZ);
|
||||
if(GZ < 5.5)
|
||||
{
|
||||
MyServo_ChangeAngle(179);
|
||||
}
|
||||
Angle_Girouette=MyGirouette_Angle(TIM4);
|
||||
MyServo_ChangeAngle(Angle_Girouette/4);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
void initImplementation(void)
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
@ -125,7 +125,7 @@
|
|||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGDARM</Key>
|
||||
<Name>(1010=752,272,1128,829,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=429,109,850,536,0)(121=247,294,668,721,0)(122=875,109,1296,536,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=123,134,717,885,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
|
||||
<Name>(1010=752,272,1128,829,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=832,432,1253,859,0)(121=247,294,668,721,0)(122=875,109,1296,536,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=751,208,1345,959,0)(132=-1,-1,-1,-1,0)(133=235,63,829,814,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
|
@ -150,6 +150,11 @@
|
|||
<WinNumber>1</WinNumber>
|
||||
<ItemText>returnValue</ItemText>
|
||||
</Ww>
|
||||
<Ww>
|
||||
<count>2</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>Angle_Girouette</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
|
@ -257,7 +262,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
|
Loading…
Add table
Reference in a new issue