Bonjour Technical
Hello Technical,PE6 does already support 'time'. Do you mean you want to use 'time' in Blockly?
View attachment 21958
Problème déjà débattu : il ont choisi de simuler le temps en nombre de boucles au lieu de temps réel...Hello Technical,
I don't use Blockly, but will there be the same Grove commands with basic ?
Thanks for the answer, but il is not the best exemple.
This is a simulation with PE5
View attachment 21959
I wrote 20000, but 2 is enough
On my computer, with PE6, the solution is : Ctrl +Alt + Suppr
Try to simulate this code with PE6, please
MM
Hello,Besqueut is correct, but it is actually the PE5 simulation that is very inaccurate - after the simulation w0 will not be a realistic value compared to a real life chip...
It is easy to test in real-time in PE6 like this:
do
inc w0
#ifdef simulating
pause 1000
#endif
loop while time<20000
http://www.picaxe.com/BASIC-Commands/Directives/hash-ifdef-simulating/
Hello Technical,In PE5 the 'time' clock runs in 'computer' time which is very inaccurate because it does not match how the real life chip works. In your example in a real chip the do-loop will loop thousands of time, but in PE5 simulation only a few hundred. So the value of w0 will be very inaccurate at the end of a PE5 simulation because it does not mirror what a real chip does to w0.
In PE6 the time clock runs in 'PICAXE simulation' time instead. Therefore it takes several thousands of loops to reach 1 second. This is similar to a real chip so w0 will be more accurate (but of course simulation is slower than a real chip, so takes longer). By adding a 'pause 1000' you also add a second of 'picaxe simulation' time, so the overall simulation is faster too.
I do not understand : how adding some time to a loop can lower the loop time ?By adding a 'pause 1000' you also add a second of 'picaxe simulation' time, so the overall simulation is faster too.
That's great news!AXE300 PICAXE Grove Board