Serial communication with Baby o& Pololu AVR programmer usb

Products that I have:, Arduino uno;
programming software/libaries: AVR Studios 6, Arduino 1.0.1, Pololu library installed.

#include <avr/io.h>
#include <pololu/orangutan.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <pololu/OrangutanSerial/OrangutanSerial.h>

char send_buffer[100];

unsigned int MilliVolt=OrangutanAnalog::toMillivolts(OrangutanAnalog::read(0));
int Volts[100];

int main()
        for(int i=0;i<100;i++){
        OrangutanSerial::sendBlocking(send_buffer, strlen("Calibrating position sensors..."));

How do I display MilliVolt from the code above with either AVR studio or Arduino using my baby o and Pololu Avr Programmer usb?

Hello. It looks like you are trying to use the C++ interface to our libraries. Are you OK with using the C interface instead? That will make life easier for you because all of our example code and Atmel Studio templates use C.

The general instructions for getting started with Atmel Studio are in the Pololu AVR Programming Quick Start Guide, and they should get you most of the way there:

There are a lot of problems with your code, but you should make sure that you can program a basic demo onto your Baby Orangutan with Atmel Studio 6 before trying to write your own code.


Think you for answering me David.

I noticed that i forgotten setBaudRate in the program, but this just a symptom not the cause of my probelm.
This might be stupid question, but i just want to know if I’m correct. i connect PD1 tx to the Rx on the pololu Avr programmer usb
and i connect PD0 Rx to the Tx on the pololu Avr programmer usb.
i been looking one of the Serial example
Should i install the Br@y Terminal to see the analog to digitial data.

Yes, your proposed wiring is correct. Also, don’t forget to connect the GND pins of both devices. Yes, you would have to install Br@y Terminal or some other terminal program to look at the data sent by the Baby Orangutan.


I modified the example for this site: .
here the modified code.

void process_received_byte(char byte)
        // If the character 'G' is received, set PC1 high
        case 'G':
            set_digital_output(IO_C1, HIGH);
        // If the character 'g' is received, set PC1 low
        case 'g':
            set_digital_output(IO_C1, LOW);
        // If the character 'c' is received, set PC2 high
        case 'c':
            set_digital_output(IO_C2, HIGH);
        // If the character 'd' is received, set PC2 low
        case 'd':
            set_digital_output(IO_C2, LOW);
        // If any other character is received, change its capitalization and
        // send it back.
            send_buffer[0] = byte ^ 0x20;
            serial_send(send_buffer, 1);
int main()
    // Set the baud rate to 9600 bits per second.  Each byte takes ten bit
    // times, so you can get at most 960 bytes per second at this speed.
    // Start receiving bytes in the ring buffer.
    serial_receive_ring(receive_buffer, sizeof(receive_buffer));
	set_digital_input(IO_C2, HIGH_IMPEDANCE);
        // Deal with any new bytes received.
        // If the user presses the middle button, send "Hi there!"
        // and wait until the user releases the button.
        //if (button_is_pressed(MIDDLE_BUTTON))
            memcpy_P(send_buffer, PSTR("Hi there!\r\n"), 11);
            serial_send(send_buffer, 11);
            // Wait for the user to release the button.  While the processor is
            // waiting, the OrangutanSerial library will take care of receiving
            // bytes using the serial reception interrupt.  But if enough bytes
            // arrive during this period to fill up the receive_buffer, then the
            // older bytes will be lost and we won't know exactly how many bytes
            // have been received.
       // }

Can some please explain why PD1 is not changing, it’s a constant High and can someone help me with Br@y Terminal for serial purposes?

It looks like you have modified our code so it should just constantly be writing “Hi there!” to the serial port. That’s a little bit extreme; could you add a “delay_ms(1000);” somewhere in the main loop so it only does that every second?

I’m not sure why TX/PD1 would just stay high constantly. I would expect it to go low several times while transmitting serial bytes. How are you looking at the signal on PD1?

What kind of trouble are you having with Br@y terminal? Did you try choosing the right COM port, choose the baud rate (9600), and clicking “Connect”? If you told me more details about what are you doing, I might be able to tell what is going wrong.


Thank you for help the David.