3PI Capabilities

Hi to all,

I just got my 3pi today and I’ve been doing some reading and looking at everyone’s projects of what they’ve been doing with it and my first question is, I got my bot with the expansion the 200 dollar model that has the mbed board and do I have to do anything extra to get the 8 LED’s working such as soldering or anything? And I also received some LED’s that came with the bot in the box where can I solder these safely and can I add more and make them blink also on and off?




It sounds like you purchased a m3pi Robot + mbed NXP LPC1768 Development Board Combo. You do not need to do anything special enable the 8 red user LEDs. There is documentation on the mbed command that controls the lines.

The through-hole LEDs are intended to be used by the 3pi when it is used by itself. There is not an easy way for you to use the through-hole LEDs with the m3pi, so I recommend sticking with the 8 user LEDs and only pursuing additional LEDs if you are completely sure you need them. If you are sure you need them, read on:

The “Included Accessories” section of the 3pi user’s guide talks about where you might solder the through-hole LEDs. However, the default 3pi serial slave software does not have control of these LEDs. So if you want to blink them from the mbed code, you would have to enhance the serial slave program, or add them to the mbed’s free IO lines. If you add them to the free I/O lines, you would need to include a proper current limiting resistor in series with it. Additional information about the m3pi can be found in the m3pi user’s guide.

- Ryan

Thanks Ryan for pointing me in the right direction, so I would want to use the prototyping area to setup extra leds correct? Also in the 3pi instructions it says you can add the LED’s to the holes just by soldering them for more color but thats all they will do is light up correct? Its ok to add therm to the bottom deck as if I didnt have the expansion right? And also is my bot able to use a ping sensor to the mbed board or would I want to take a different route with that? My main goal is to have my bot able to see things in front of it and make itself correct and continue on like the wall seeing project, I just don’t want to mess anything up on the bot and get it working like I mentioned. There is a project like I’m talking about but the person that has done this doesn’t reveal any way of seeing how it was set up with the ping sensor or the program. I’m new to this all and very eager to learn.

Thanks, again Shawn

The prototyping area is a fine place to add additional LEDs to the m3pi. The 3pi through-hole LED spots are controlled by the same I/O as the SMT green and red LEDs on the bottom of the board, so they will light up when those are on. The red LED will be on because the serial slave program uses the UART which is also connected to the red LED. The green one will not turn on unless you write a new version of the serial slave code. The PING))) is a 5V device, so you might need to do some level-shifting to get it to work with the mbed, but I think it should be possible. We offer some digital distance sensors that work at 3.3V that you might consider. If you provide a schematic diagram for how you plan to wire something, I would be glad to take a look to help ensure it is safe.

- Ryan

Hey Ryan,

Sorry to be picking on you but I’m super new at robotics and still very new at programming, I feel dumb, but ive uploaded the hello world program to the mbed got it to blink. Now i’m trying to figure out the next steps what is it I need to do lets say to get the mbed to communicate with the lower deck of the bot and get it to do the line following program? I dont know how to write code just yet any suggestions to where I can learn and get a good start at some diffrent code and programs? I really dont know how to make things happen with this bot yet.

Ryan I got to playing with the hello world code by just changing a few things here is an example:

#include "mbed.h"

DigitalOut myled(LED3); DigitalOut myled(LED2);

int main() {
    while(2) {
        myled = 3;
        myled = 0;

I changed it to LED 3 and made it blink then I changed it to a 2 it changed it but I cant figure out how to write code, once again new to this how to make more of them light along with the one LED, I’m at least trying :frowning:

Thanks for all your help

Well, if you don’t know how to program but you want to write programs, you should learn how to program. There are lots of resources on the internet that teach you how to program C++. There are many books and tutorials for learning to program. Also, if you are not that familiar with programming, it is probably safer to start programming on a computer, because there is less chance of breaking something.

By the way, if you search the mbed website for m3pi, you can find a lot of example code.

- Ryan