Reading data from QTR sensors, PWM and sending it to PC

Hey,

I bought 2 Wixel modules and a m3pi robot. I uploaded the program that is on the site (LineFollower PID - https://www.pololu.com/docs/0J21/7.c) to the robot. Everything works good, the robot follows the line. I would like the first Wixel module that is connected to the robot (COM6) to send a 1x7 array (QTRSensor1 QTRSensor2 QTRSensor3 QTRSensor4 QTRSensor5 LeftMotorPWM RightMotorPWM) to the second Wixel plugged in to the PC (COM5) every 20 ms. Did anyone do something like that and could help me? Can this array 1x7 be saved to a txt file? Sorry if I made mistake, my English isn’s so good.

~Martin

Hello, Martin.

We have not done any projects exactly like that, but it should be possible if you are able to write some C code for the 3pi.

Now that you know your 3pi works and are able to program it, the next step is probably to set up the wireless serial link between your computer and the robot using the Wixels. I recommend using the Wixel’s Wireless Serial app. We provide a pre-built version of that app so you do not need to compile it yourself. You can find out more in the Wixel User’s Guide, which is available from the “Resources” tab of its product page:

https://www.pololu.com/product/1337/resources

Are you using an mbed on your robot, or are your serial signals going to go directly from the 3pi to the Wixel?

Saving the readings to a text file should not be hard. You could use Tera Term, a terminal program for Windows that can log data to a text file.

Please let me know if you get stuck or have any further questions.

–David