Need help to realize loudness indicator


#22

Here is my version of the mBot Sound Led Strip Code and connections

ledmatrix_sound_sensor.sb2 (74.8 KB)
I ordered the 16 led strip, the Me RJ45 adapter v2.2 and the Me Sound Sensor v1.1
You should be able to use the 32 led strip by changing the led_count variable.

The RJ45 adapter is connected to port 3
The Led strip is connected to slot 2 of the RJ45 adapter
The Sound sensor is connected to port 4

This program can be uploaded to the mBot and run without the USB tether.


#23

I think one issue you are having is that the round trip from the PC/Mac is too slow so you need to make this a pure arduino code that you upload to the board and run without the PC. If you avoid using the commands that are limited to the PC you should be good to go. Replace the “when (flag) clicked” with “mBot Program” then upload to arduino, when the unit is turned on it will run that program.


#24

@indream I was unable to get my 32 led strip to work using only scratch due to a bug in the scratch to arduino initialization code for the led

The init code looks like this:

void setup(){
    led_count = 32;
    rgbled_3.setNumber(3==7?2:16);
    led_count = 32;
    
}

The change I made to get it to work is to change the second line to:

rgbled_3.setNumber(3==7?2:32);

But I have to do that in the arduino IDE.
Is there something that I need to do for the code to realize I have a 32 led strip instead of a 16?
Dan


#25

Great! looks good. It is also impressive to see it is able to work with “mcore” board.


#26