srf08 - confused

20 Mar 2011

In the following example code where would I expect to see the output of the printf statement? Do I have to include and lcd display? Sorry if this looks simple.

#include "mbed.h"
#include "SRF08.h"

SRF08 srf08(p9, p10, 0xE0);      // Define SDA, SCL pin and I2C address

int main() {

    while (1) {
       printf("Measured range : %.2f cm\n",srf08.read());
       wait(0.1);
    }

}

20 Mar 2011

Hi...

apologies if I don't know all the correct terms..

but, it would go down the USB wire, and print out onto any terminal you were using on your PC. I use Teraterm.

When you start Teraterm, you select the serial port radio button, and then it shows you a list of ports, one of them will be mbed. Choose that.

you get a terminal. (a small blank screen)

and printf prints to that.

Teraterm is free iirc and you can just download it. Some people use PUTTY, but I've never used that.

20 Mar 2011

This link in the Handbook also has some information on how to configure your host for receiving the serial data being sent by printf()s in your code.

20 Mar 2011

Thank you so much chaps for this advice I use Ubuntu on my laptop so I'll have a real look at this as soon as I get the srf08 hooked up

21 Mar 2011

I'm in the GNU terminal mode using Ubuntu 10.10 I can see the mbed connected using ls /dev/ttyACM0 but how do I see the Hello World message? how do I get into the ttyACM0 folder?? I've looked at the GNU commands but I'm struggling to find the one that I need?? Any help greatly appreciated, thanks.

21 Mar 2011

I'm not confused anymore :-)

screen dev/ttyACM0

I understand it now! and I can see Hello World!

21 Mar 2011

Just a point I learned today for any other newbies like me, the srf08 gives the impression it is working at 4.42v from my variable dc supply except that it just gives out 0.00 figures. Changing the dc supply to the next selectable output 5.82v makes the circuits work correctly and displays values.