Forums » Support

Back To Topics

Scratch on Windows support

    • 10 posts
    September 7, 2017 4:27 AM CEST

    [blockquote]Emi Grago said:

    ... there is allways a little delay in either one of the motors/tracks beginning to run which makes them start asynchronous when they are supposed to start at the same time. This has the effect that the vehicle steers a little to the left or to the right before it goes straight so that the controlling becomes a littlebit unreliable and requires steering corrections after i hit forward/backward.
    The question is whether i can make improvement to my script to make the motors start synchronously?.

     

    Yes you can improve the script. You should use messages as much as possible. Scratch is an interpreted language which means each statement is executed in series. No parallel instructions are possible. The PC is also not a microcontroller so you cannot program or setup parameters for ports and have them all start simultaneously at a trigger or at a specific clock cycle.

    Using messages still causes a delay, however, it is much smaller in my experience. For some reason the messages seem to bypass the problem with sequential instructions. I can only guess that their code is pre-processed and in machine code format, but I have no idea really.

    In any case, what you can do is send one message that activates both motors. Find out which motor still has a minor delay. Set that motor power higher so it can 'catch up' to the motor that started first. Then after a small delay that you have to experiment with, set it to the same value as the first motor. In my example I assume motor B starts slightly after motor D. So I set its power higher and after 1 second restore it to the same as that for motor D.

     Looking at your code, I would also set port direction first, before sending the message to turn the motors on. That would take the delay in interpreting the port direction out of the equation.

    My advice is to use messages as often as possible. 

     

     


    This post was edited by Wolly Barabash at September 7, 2017 4:35 AM CEST
    • 19 posts
    September 5, 2017 11:27 PM CEST

    still no information about how to start 2 motors at the same time?
    i have been trying various ways to get 2 motors to start synchronously on button press, but since you allways end up with a sequence of 2 seperate blocks for the 2 motors the motor that is on top in the sequence will start a tiny bit earlyer most of the time which makes the controlls unreliable... id like to have a way to start multiple motors with the same block!

    • 19 posts
    August 14, 2017 1:34 PM CEST

    another question:

    I bought lego power function leds 8870 to use with my sbrick and tracked racer.
    I have the leds connected to the sbricks A Port, i can swich them on and off via android app but when i try to switch them on via scratch it doesnt work (the sbrick connection to scratch is confirmed and other scripts work fine)! 
    I am currently using the sbrick driver beta 1.0 
    Is this a known issue or am i doing something wrong?


    this is the scratch command im trying to use:



    EDIT:

    The Solution was to use the "set port value" command instead



    This post was edited by Emi Grago at August 15, 2017 10:37 AM CEST
    • 486 posts
    August 12, 2017 12:05 PM CEST

    [blockquote]Emi Grago said:

    llo Everybody,

    i have the following Question regarding Scratch scripting for Sbrick:

    I created the following script (i dont have experience in programming so forgive me if my question is trivial), and with the "w" key both tracks are supposed to go forward and with the "s" key both keys are supposed to go backward. Unfortunately, after hitting one of the keys, there is allways a little delay in either one of the motors/tracks beginning to run which makes them start asynchronous when they are supposed to start at the same time. This has the effect that the vehicle steers a little to the left or to the right before it goes straight so that the controlling becomes a littlebit unreliable and requires steering corrections after i hit forward/backward.
    The question is whether i can make improvement to my script to make the motors start synchronously?

    Click here for Larger Image Click here for Larger Image Click here for Larger Image



    On a side note: maybe it would be good to have an instruction block in scratch to start multiple motors at the same time?

    [/blockquote]

    Dear Emi, 

    I have forwarded the questions to my collegaue. 

    I still waiting for the response. 

    We ask for your patience. :)

    Thank you!

    Best,
    Balint

    • 19 posts
    August 10, 2017 2:35 PM CEST

    llo Everybody,

    i have the following Question regarding Scratch scripting for Sbrick:

    I created the following script (i dont have experience in programming so forgive me if my question is trivial), and with the "w" key both tracks are supposed to go forward and with the "s" key both keys are supposed to go backward. Unfortunately, after hitting one of the keys, there is allways a little delay in either one of the motors/tracks beginning to run which makes them start asynchronous when they are supposed to start at the same time. This has the effect that the vehicle steers a little to the left or to the right before it goes straight so that the controlling becomes a littlebit unreliable and requires steering corrections after i hit forward/backward.
    The question is whether i can make improvement to my script to make the motors start synchronously?

    Click here for Larger Image Click here for Larger Image Click here for Larger Image



    On a side note: maybe it would be good to have an instruction block in scratch to start multiple motors at the same time?


    This post was edited by Emi Grago at August 10, 2017 2:40 PM CEST
    • 486 posts
    June 23, 2017 5:09 PM CEST

    [blockquote]Alyona Dobrodey said:

    Hello! I have some questions for you. Can I program SBrick on Scratch without BLED112 Bluetooth Low Energy (BLE) USB Dongle
    on Windows 10? I have two programs: SBrick and S2Bot. When SBrick connects to Scratch, I have one type of block, and I can
    turn on the engine and assign a connection for each port. When S2Bot connects to Scratch, I have another type of block:
    set the direction, turn the motor on for 5 seconds, but the computer can not connect to the SBrick electronic component.
    How can I solve this problem?
     

     

    [/blockquote]

    Hello Alyana, 

    The BLED112 is only necessary for using the S2Bot. The new plugin works without the dongle. 

    Here you can find both of them, https://social.sbrick.com/wiki/view/pageId/37/slug/education

    If you need any further help, just let us know!

    Best regards, 
    Balint
    SBrick Team

    • 10 posts
    June 23, 2017 1:42 PM CEST
    Hello! I have some questions for you. Can I program SBrick on Scratch without BLED112 Bluetooth Low Energy (BLE) USB Dongle
    on Windows 10? I have two programs: SBrick and S2Bot. When SBrick connects to Scratch, I have one type of block, and I can
    turn on the engine and assign a connection for each port. When S2Bot connects to Scratch, I have another type of block:
    set the direction, turn the motor on for 5 seconds, but the computer can not connect to the SBrick electronic component.
    How can I solve this problem?
     

     


    This post was edited by Alyona Dobrodey at June 23, 2017 1:52 PM CEST
  • March 28, 2017 10:31 PM CEST

    [blockquote]Balint Mezei said:

    [blockquote]Krzysztof Przedniczek said:

    Let me explain by this small example above. I have Sbrick with the motor connected to port A and I run this small program. I expected that nothing visible should happen but the motor started rotating.Is it an expected behaviour?

    I expected that to turn the motor on I should also use "turn" block (like in the example below) not only "set" block.

     

    [/blockquote]

    Hello! 

    Thank you, I have forwarded the question! 

    Soon we will get back to you! 

    Till that time we ask for your patience, 

    Thanks, 
    Balint

    [/blockquote]

     

     

    Dear SBrick Team,

    I'm still waiting.........

    • 4 posts
    March 22, 2017 7:11 PM CET

    Thank you!

    • 486 posts
    March 22, 2017 12:07 PM CET

    [blockquote]Jürgen Göbl said:

    Hi,

    is it possible to connect a proximity sensor to sbrick in scratch or do i need a sbrick plus?

    Can I connect 3 Sensors to 1 sbrick?

    Thanks and Regards

    Jürgen

    [/blockquote]

    Dear Jürgen, 

    The sensors are compatible only with the SBrick Plus.

    The SBrick Plus can handle 4 sensors at the same time, so the answer is yes. :) 

    One port can handle one sensor. 

    If you have any further questions just let us know. 

    Best regards,
    Balint
    SBrick Team

     

     

    • 4 posts
    March 22, 2017 10:46 AM CET

    Hi,

    is it possible to connect a proximity sensor to sbrick in scratch or do i need a sbrick plus?

    Can I connect 3 Sensors to 1 sbrick?

    Thanks and Regards

    Jürgen

    • 4 posts
    March 12, 2017 7:35 AM CET

    Hi,

    Thank you!

    Regards

    Jürgen

  • March 11, 2017 8:54 PM CET

    Connecting 2 sbricks is possible when you name each brick. Using then SBrick Tester application in Windows. One of my sbricks is named C9 (it is case sensitive I just found out) and the other sbrick.

     

    Good luck! J.N de Jong

    • 4 posts
    March 11, 2017 12:52 PM CET

    Hi, is it possible to connect more the one sbricks to scratch?

    Thanks

    Jürgen

  • March 3, 2017 12:01 AM CET

    Hi,

    Any news here?

    • 486 posts
    February 16, 2017 9:12 PM CET

    [blockquote]Krzysztof Przedniczek said:

    Let me explain by this small example above. I have Sbrick with the motor connected to port A and I run this small program. I expected that nothing visible should happen but the motor started rotating.Is it an expected behaviour?

    I expected that to turn the motor on I should also use "turn" block (like in the example below) not only "set" block.

     

    [/blockquote]

    Hello! 

    Thank you, I have forwarded the question! 

    Soon we will get back to you! 

    Till that time we ask for your patience, 

    Thanks, 
    Balint

  • February 16, 2017 12:04 AM CET

    Let me explain by this small example above. I have Sbrick with the motor connected to port A and I run this small program. I expected that nothing visible should happen but the motor started rotating.Is it an expected behaviour?

    I expected that to turn the motor on I should also use "turn" block (like in the example below) not only "set" block.

     

    • 486 posts
    February 15, 2017 2:51 PM CET

    [blockquote]Krzysztof Przedniczek said:

    Hi,

    in scratch for windows "set motor A power to 100" block sets motor A power to 100, what is expected and then turns motor A on, what is unexpected. The same issue involved block "set motor A direction to this way" but it was fixed recently (probably in new firmware). When you plan to fix this issue with "set motor A power to 100" block?

    [/blockquote]

    Hello, 

    Our developers just upgraded most of the blocks, you it has to work. We have not experienced any problem like that. 

    Could you tell us more about what you want to set? This part is not fully clear for us, "then turns motor A on, what is unexpected".

    Thank is advance, 

    Best regards,

    Balint
    SBrick Team

  • February 11, 2017 11:38 PM CET

    Hi,

    in scratch for windows "set motor A power to 100" block sets motor A power to 100, what is expected and then turns motor A on, what is unexpected. The same issue involved block "set motor A direction to this way" but it was fixed recently (probably in new firmware). When you plan to fix this issue with "set motor A power to 100" block?

    • 486 posts
    February 2, 2017 11:25 AM CET

    [blockquote]Wolly Barabash said:

    Update, I crated a template scratch file from the red SBRICK application and now I have an extension that shows tilt and movement sensor etc., but in a completely unfamiliar format:  such as: "TILT SENSOR NAME Sbrick PORT A".  My tilt sensor is on port A. I have tried to use this block to no avail. 

    A sample program would be great as well as an indication of whether to use the SBRICK application template or the S2BOT template.  I think it should be the SBRICK app as it is the only one with sensors. But how do I use the extension? I would rather not spend an hour on this...

     

    [/blockquote]

    Dear Barabash, 

    I have forwarded your suggestion to our developers, they will see what to do. :) 

    We ask for your patience, 

    Best wishes,
    Balint
    SBrick Team

    • 10 posts
    February 2, 2017 6:59 AM CET

    Update, I crated a template scratch file from the red SBRICK application and now I have an extension that shows tilt and movement sensor etc., but in a completely unfamiliar format:  such as: "TILT SENSOR NAME Sbrick PORT A".  My tilt sensor is on port A. I have tried to use this block to no avail. 

    A sample program would be great as well as an indication of whether to use the SBRICK application template or the S2BOT template.  I think it should be the SBRICK app as it is the only one with sensors. But how do I use the extension? I would rather not spend an hour on this...

     

     

     

    • 10 posts
    February 2, 2017 6:11 AM CET

    My Windows system is not officially Windows 10 (So I upgraded an older version).

    I am using the S2Bot with the dongle. 

    I cannot read my distance sensor. Only the motor controls are loaded from the template when I add the extension. I can control motors, but no inputs!

    • 486 posts
    January 28, 2017 6:30 PM CET

    Hello Guys, 

    If the Windows system is not officially Windows 10 (So you upgraded an older version) the new plugin won't work. 

    In this case we could only advise the S2Bot with the dongle. 

    If you need any further help, please contact us again, 

    Best regards,

    Balint
    SBrick Team

    • 7 posts
    January 28, 2017 5:10 PM CET

    I don't know but I have the same problem on two of my three PCs. Sbrick have not explained what the exact problem is. Unfortunately, S2Bot from Revolution Education only supports the SBrick outputs at the moment (i.e. you can't use the sensors with SBrick Plus). So, I can't use the SBrick properly until some of that software is updated. Very disappointing.

    • 4 posts
    January 28, 2017 4:58 PM CET

    [blockquote]Steve Smythe said:

    Is your Windows version one that came with your PC or did you upgrade from a previous version?

    [/blockquote]

    Yeah, it's an upgrade but with a clean install after the upgrade.

    Why is this a problem and how can I solve it.