How to increase 3pi speed

Hi david and Ben,

Thanks for the reply. Anyways, I am using QTR-RC sensors - can I still used the IO_A0 on this sensor or do I need to but the other line sensor you have?

Thanks again,

Hi David,

If so that I can used the QTR-RC in the analog pin - then I might have some problems - since I will be using at least 4 analog pins for my other sensors. What I have done so far were these:

I managed to used only 5 line sensors:
unsigned char qtr_rc_pins[] = {11, 14, 15, 0, 1}; // I tried to get rid of PB4 as I need the serial port at UART1
Used UART1 as my wireless tx/rx to my PC
serial_set_baud_rate(UART1, 9600); // using UART1
serial_receive_ring(UART1, receive_buffer, sizeof(receive_buffer));

I tested the serial - works perfectly. But when I tried to run the robot - it’s kind of weird - one motor is not running the way it used to be - and I guess it still have problems even when I tried not to used the PB4.

what did I miss?

I’m not saying that you should put all of your QTR-RC sensors on port A (the analog port). You can have some of them on port A and some of them other ports, according to what you need.

Pin numbers 14-20 have a different definition on the SVP (and X2) than they do on our other devices, so to make your code clear you should use the IO_* macros. For example: { IO_B3, IO_C0, IO_C1, IO_D0, IO_D1 }. Also have you downloaded and installed the new version of the Pololu AVR Library I linked to in my last post? You should do that so that the PololuQTRSensors section of the library interprets those new pin numbers correctly. After you do that, you should be able to use all 8 of your QTR sensors if you want to and you have enough free pins.

Also, why do you think that PB4 is related to UART1? As far as I know, PB4 is related to SPI, but not UART1. Do we have any documentation that mistakenly says that PB4 is related to UART1? If so, you should tell us where that documentation is so we can fix it.

Great!

What are the differences between the program that previously worked and the program that doesn’t work now? Can you load the previously-working program on the SVP and see if it sill works? Which version of the Pololu AVR Library are you using? Can you simplify your program and post the simplest possible program that doesn’t work, and describe the expected behavior and actual behavior?

-David

Hi Dave,

The only difference for the working code was that I used PB4 on it and now I used:

PB3, PC0, PC1, PD0, PD1

I checked each of the sensor on this new pin connections and it reported correct readings. But when I started to run the robot - it veers to the left and somehow lost it orientation.

So I put the PB4 back and get commented my serial initialization and it works perfectly.

Previously used ports was: PB3, PB4, PC0, PC1 PD0.

Hi Dave and Ben,

I got it to work after I put the new libraries you send.
thanks a lot.