Help using readsoundLevel (RobobuilderLib)

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
3 postsPage 1 of 1
3 postsPage 1 of 1

Help using readsoundLevel (RobobuilderLib)

Post by ingeniado » Sun Nov 28, 2010 12:54 am

Post by ingeniado
Sun Nov 28, 2010 12:54 am

Hello,

I'm developing a simple C# script in order to control Robobuilder via Bluetooth and RobobuilderLib (thanks l3v3rz :wink: )
Everything goes OK but I'm not able to get the readsoundLevel function returning any value.
I think my error is the level parameter, what value have we got to put?, wich is the range?. I've tested with 1, 10, 1000 but I get everytime 0 as returning value.

any example using this function?

thanks.
Miguel A.
Hello,

I'm developing a simple C# script in order to control Robobuilder via Bluetooth and RobobuilderLib (thanks l3v3rz :wink: )
Everything goes OK but I'm not able to get the readsoundLevel function returning any value.
I think my error is the level parameter, what value have we got to put?, wich is the range?. I've tested with 1, 10, 1000 but I get everytime 0 as returning value.

any example using this function?

thanks.
Miguel A.
ingeniado offline
Robot Builder
Robot Builder
Posts: 14
Joined: Tue Nov 16, 2010 7:33 pm

Post by l3v3rz » Sun Nov 28, 2010 1:13 pm

Post by l3v3rz
Sun Nov 28, 2010 1:13 pm

Good to hear some one using the library.

I'm assuming you're using standard firmware 2.26 or better.

If so then the level is the minimum level for it to return a value - so try setting it to 1 - even then it seems to need quite a loud noise to trigger. I think this is because they calculate the level by averaging over a large number of samples over about 500ms - so it needs quite a sustained noise to trigger

So for : public int readsoundLevel(int timeout, int level).

try a timeout of 10000 (i.e 10s) and a level of 1. The actual value read is returned, so you can print that out and see if the level needs adjusting but I doubt you'll see any value more than 10.

Incidentally the IR doesn't seem to work at all (this is the firmware not my library), but PF1/2 button input work well and so does reading the PSD and accelerometer.
Good to hear some one using the library.

I'm assuming you're using standard firmware 2.26 or better.

If so then the level is the minimum level for it to return a value - so try setting it to 1 - even then it seems to need quite a loud noise to trigger. I think this is because they calculate the level by averaging over a large number of samples over about 500ms - so it needs quite a sustained noise to trigger

So for : public int readsoundLevel(int timeout, int level).

try a timeout of 10000 (i.e 10s) and a level of 1. The actual value read is returned, so you can print that out and see if the level needs adjusting but I doubt you'll see any value more than 10.

Incidentally the IR doesn't seem to work at all (this is the firmware not my library), but PF1/2 button input work well and so does reading the PSD and accelerometer.
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by ingeniado » Tue Nov 30, 2010 11:08 pm

Post by ingeniado
Tue Nov 30, 2010 11:08 pm

Thanks l3v3rz.

I've tested the script following your instructions and I could find that the problem is the bluetooth link, it is responsible for a delay in the communication (at least in with my hardware) that causes a strange behavior.

Using the serial RS232 link, yes, I get some results that I could use (with some fine tunning), but using the bluetooth link no value is returned. My motion algorithm doesn't work very well (I suppose It's as a result of the dealy in the link)

regards.
Miguel.

PD: I'm waiting for a welding soldering iron in order to install the triaxial acceleration sensor module, I will post my results with bluetooth and robobuilderlib.
Thanks l3v3rz.

I've tested the script following your instructions and I could find that the problem is the bluetooth link, it is responsible for a delay in the communication (at least in with my hardware) that causes a strange behavior.

Using the serial RS232 link, yes, I get some results that I could use (with some fine tunning), but using the bluetooth link no value is returned. My motion algorithm doesn't work very well (I suppose It's as a result of the dealy in the link)

regards.
Miguel.

PD: I'm waiting for a welding soldering iron in order to install the triaxial acceleration sensor module, I will post my results with bluetooth and robobuilderlib.
ingeniado offline
Robot Builder
Robot Builder
Posts: 14
Joined: Tue Nov 16, 2010 7:33 pm


3 postsPage 1 of 1
3 postsPage 1 of 1
cron