Khemiri Mahrane
/
Nucleo_PWM
ServoProg
Diff: main.cpp
- Revision:
- 2:05faa0892bec
- Parent:
- 1:c56c4fb5cb59
--- a/main.cpp Wed Feb 10 10:18:22 2016 +0000 +++ b/main.cpp Thu Feb 18 10:58:50 2016 +0000 @@ -63,6 +63,30 @@ Pince_Glissement_Droit(50); Pince_Glissement_Gauche(0); } + +void Pince_Cylindre_Droit(int a) +{// +PWM5.period_ms(20); +PWM5.write(map (a,0,180,0.028f,0.12f)); +} + +void Pince_Cylindre_Gauche(int a) +{// +PWM6.period_ms(20); +PWM6.write(map (a,0,180,0.028f,0.12f)); +} + +void Pince_Cylindre_Haut() +{ +Pince_Cylindre_Gauche(0); +Pince_Cylindre_Droit(0); +} +void Pince_Cylindre_Bas() +{ +Pince_Cylindre_Gauche(0); +Pince_Cylindre_Droit(0); +} + int main() {