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.
Revision 4:4316eebf4a9b, committed 2019-06-14
- Comitter:
- Gaetan_Andrieu
- Date:
- Fri Jun 14 09:04:09 2019 +0000
- Parent:
- 3:66df7d295245
- Commit message:
- Robot joueur de tennis
Changed in this revision
| Pixy.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 66df7d295245 -r 4316eebf4a9b Pixy.h
--- a/Pixy.h Mon Mar 14 18:53:43 2016 +0000
+++ b/Pixy.h Fri Jun 14 09:04:09 2019 +0000
@@ -70,6 +70,23 @@
* @param pixy the pointer to the pixy object to run the demo on
* @param serial the optional serial pointer to display output to
*/
+
+
+template <class TPixyInterface> void runPanTiltDemo(TPixy<TPixyInterface>* pixy, uint16_t blocks, int32_t tiltError)
+{
+ ServoLoop tiltLoop(200, 250);
+
+ for(int i=0; i<10; i++)
+ {
+ if (blocks) {
+ tiltError = pixy->blocks[0].y - Y_CENTER;
+ tiltLoop.update(tiltError);
+ pixy->setServos(0, tiltLoop.m_pos);
+ }
+ }
+}
+#endif
+/*
template <class TPixyInterface> void runPanTiltDemo(TPixy<TPixyInterface>* pixy, Serial* serial = NULL)
{
ServoLoop panLoop(-150, -300);
@@ -105,4 +122,5 @@
}
}
}
-#endif
\ No newline at end of file
+#endif
+*/
\ No newline at end of file