IPAB Neuromorphic / Mbed 2 deprecated Koala_test

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
IPAB
Date:
Tue Jun 29 11:38:25 2010 +0000
Commit message:

Changed in this revision

Koala.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Koala.lib	Tue Jun 29 11:38:25 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/IPAB/code/Koala/#c32adf6f5ec6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jun 29 11:38:25 2010 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+#include "Koala.h"
+
+
+Serial PC(USBTX,USBRX);
+Koala koala(p28,p27,38400);  // tx, rx, baudrate
+
+// Just to check different speeds.
+#define SPEED   3
+#define LS      3
+#define RS     -5
+
+
+int main() {
+
+    PC.baud(38400);
+
+    PC.printf("\r\nKoala Test Code\r\n");
+    PC.printf("=================================\r\n");
+    PC.printf("Initialising...\r\n");
+
+
+    PC.printf("Initialising position (0,0)\r\n%c\r\n",koala.set_pos_cnt(0,0));
+
+    PC.printf("Moving with speed (%d,%d)\r\n%c\r\n",LS*SPEED,RS*SPEED,koala.set_speed(LS*SPEED,RS*SPEED));
+    wait(2);
+    PC.printf("Stop moving...\r\n%c\r\n",koala.set_speed(0,0));
+    wait(0.5);
+
+    int nCountL,nCountR;
+    koala.read_position(&nCountL,&nCountR);
+    PC.printf("Counts:\t%d\t%d\r\n",nCountL,nCountR);
+    wait(1);
+
+    /* Read channel input
+    for (int i=0;i<1000;i++) {
+
+        PC.printf("Ears:\t%d\t%d\r\n",koala.read_channel(0),koala.read_channel(1));
+    }
+    */
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jun 29 11:38:25 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/3944f1e2fa4f