setInterval & setTimeout not working as expected #468
Replies: 6 comments
-
Posted at 2015-10-20 by DrAzzy Can you tell us what code you're running? Also, how are you sending it, by typing in lefthand side, or entering in righthand side and clicking send to Espruino? Also, what board are you using? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-21 by user58511 sorry, a pico typing into the lift side: setTimeout(getTime,1024) nothing happens a second later |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-21 by @gfwilliams Hi, I think your problem is that you are getting the time after 1.024 seconds, but are just not printing it. If you want to print it you could try:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-21 by user58511 Nope, that didn't do it... I got it working now, but I don't know what the problem was... I use a little powered hub to extend my USB ports to a more comfortable location. This morning I tried removing that hub and using it direct into my USB port -- and it worked. So I put the hub back in and tried it again in the hub, and it didn't work -- so I tried it in a different slot on the hub and it worked. Then again in slot #3 and it didn't work, then the rest of the slots and it did work. And now it's working in slot #3. I don't have any polite words I can use, so I'll just say thanks to everyone who tried to help! :) Al; |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-21 by DrAzzy Usb hub voodoo. I had a hub like that. The ports went one by one, failing for more and more devices, until nothing worked in any port. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-21 by @allObjects
...and that's why grown ups just move on! ;-) (move on by crativity) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-10-20 by user58511
I followed the quickstart and the setInterval command doesn't work - the led doesn't flash
I can turn it on and off with toggle() -- but setInterval doesn't call toggle?
getTIme() is incrementing as I call it
I expected setTimeout(getTime,1024) to output the time in a second
it didn't...
my startup says:
what am I doing wrong?
thanks
al;
( I'm a long time javascript developer, so I'm very confused when something this simple doesn't work )
Beta Was this translation helpful? Give feedback.
All reactions