
Simple wireless serial test using a pair of Pololu Wixels. Uses m3pi as a convenient dev board, since it is prewired for a Wixel.
Revision 0:fdee2dea0648, committed 2012-03-11
- Comitter:
- aworsley
- Date:
- Sun Mar 11 11:05:44 2012 +0000
- Commit message:
Changed in this revision
diff -r 000000000000 -r fdee2dea0648 m3pi.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m3pi.lib Sun Mar 11 11:05:44 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/chris/code/m3pi/#4b7d6ea9b35b
diff -r 000000000000 -r fdee2dea0648 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Mar 11 11:05:44 2012 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +#include "m3pi.h" + +// Quick test for a pair of Pololu Wixels, both configured with Wireless Serial App (download from Pololu) + +// m3pi Robot is used as a convenient dev board, since it has a socket for a Wixel already, and connects +// to the Wixel on pins 28/27/26 (Tx/Rx/nReset). + +// Note the nReset is optional, and the code works without it (thanks to internal pullup resistors). +// However, don't declare p26 as a Digital output unless you plan to use it as the Wixel nReset, in which case +// you need to drive it high to bring the Wixel out of reset. + +m3pi m3pi; +Serial Wixel(p28, p27); // tx, rx +Serial PC(USBTX, USBRX); +//DigitalOut Wixel_nReset(p26); // don't declare unless you want nReset capability + +int main() +{ + m3pi.locate(0,0); + m3pi.printf("Wixel!"); // need to send something to the m3pi just to stop it running the demo app... + //Wixel_nReset = 1; // take the Wixel out of reset + Wixel.baud(9600); // Wixel default baud rate (can configure other rates via Wixel config app...) + while(1) + { + Wixel.printf("Hello Wixel\r\n"); + while (Wixel.readable()) + { + PC.putc(Wixel.getc()); + } + wait_ms(1000); + } +}
diff -r 000000000000 -r fdee2dea0648 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Mar 11 11:05:44 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4c0c40fd0593