Function wait(1seconde) not exactly one seconde


#1

Dears,
I’m a new in programming with mBlock + Arduino, and the first succseful example that i made is the simple Led Blinking

image

But, when i check the time, it’s not exactly one seconde (it’s random and it’s about 1.2)
i’m confused whith this example, and i cannot progress to others.

can one here give me an explanation ?
many thanks in advance.


#2

You must configure arduino (upload special sketch) to use it online, or you must use “Arduino Program” block and after upload your program - arduino will worked offline.


#3

Hi Abaddon,
what’s the special sketch ? in fact i want to work online with arduino. (in order to develop some animation script with Lutins and others)

many thanks for your replay.


#4

This page http://www.mblock.cc/docs/upgradefirmware/

and this http://www.mblock.cc/docs/the-getting-started-guide/

(upload special sketch - it mean upgrade firmware in mBlock)


#5

Hi Abadon,
of course all thoses steps are well done.
mBlock software is connected to Arduino, and firmware upgrade is OK (the Led is blinking)
I can even check the arduino script generated (and it’s OK)
but when i use Scratch programming i see this delay not set to 1 second exactly but to 1.2 as described in my first comment
and when i use Arduino Programming (with mBlock) all is fine.


#6

I’m sorry, I did not understand it at time.


#7

After deep investigation, it seems that the problem is related to block : set digital pin output as HIGH/LOW
i’ve tried another example (7segment LED) to pass from one step to another it takes much time…
i’ve compared also the time response between mBlock and Snap4Arduino or Scratch4Arduino logiciels.
mBlock take more time to execute one commande.

it’s strange !!