Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: PTC3471 QEI USBDevice mbed
Revision 2:61c074362ef1, committed 2018-08-16
- Comitter:
- lcaepusp
- Date:
- Thu Aug 16 13:40:52 2018 +0000
- Parent:
- 1:e2066df0a7a6
- Child:
- 3:8736b05d400a
- Commit message:
- Template PTC3471 2018 - Novo sentido de rota??o do bra?o
Changed in this revision
| PTC3471.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PTC3471.lib Thu Aug 09 19:45:40 2018 +0000 +++ b/PTC3471.lib Thu Aug 16 13:40:52 2018 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/lcaepusp/code/PTC3471/#3e57f111bace +https://developer.mbed.org/users/lcaepusp/code/PTC3471/#c26257e7778a
--- a/main.cpp Thu Aug 09 19:45:40 2018 +0000
+++ b/main.cpp Thu Aug 16 13:40:52 2018 +0000
@@ -14,7 +14,8 @@
Ticker Control_Interrupt; // Interrupção de Tempo para acionamento do algoritmo de controle
-QEI Encoder_Motor (PTD0,PTB17,NC, 300, QEI::X4_ENCODING); // Objeto de leitura do encoder do motor
+//QEI Encoder_Motor (PTD0,PTB17,NC, 300, QEI::X4_ENCODING); // Objeto de leitura do encoder do motor
+QEI Encoder_Motor (PTB17,PTD0,NC, 300, QEI::X4_ENCODING); // Objeto de leitura do encoder do motor
QEI Encoder_Pendulo (PTA12,PTA13,NC, 600, QEI::X4_ENCODING); // Objeto de leitura do encoder do pêndulo
DigitalOut Horario(PTC1); // DigitalOut que sinaliza se deve virar o motor no sentido horário
@@ -119,13 +120,13 @@
if(u<0){
Motor = -u;
- Horario = 0;
- AntiHorario = 1;
+ Horario = 1;
+ AntiHorario = 0;
}
else if(u>0){
Motor = u;
- Horario = 1;
- AntiHorario = 0;
+ Horario = 0;
+ AntiHorario = 1;
}
else{
Motor = 0;