Avatar for Gordon

Gordon

Member since Sep 2013 • Last active Jun 2018

Most recent activity

  • in Interfacing
    Avatar for Gordon

    Can you try Serial1.setup(9600,{tx: tx pin, rx: rx pin});? When you don't specify any pins it defaults to using a standard set of pins of each UART, but on the WiFi those might happen to overlap with USB.

    • 4 comments
    • 135 views
  • in ESP32
    Avatar for Gordon

    The timeout is in microseconds (don't ask why!), so 100000 is 0.1 seconds. So it's probably working just fine.

    ESP8266/ESP32 deep sleep does work by completely rebooting the device. If you want something that doesn't then buy an official Espruino board which can sleep without losing the contents of memory.

  • in General
    Avatar for Gordon

    "save code to RAM" to "save directly to flash" and then back to RAM

    You may find that you now have your 'old' code stored in flash memory as well as new code - you can remove that with reset(true).

    It might help to see http://www.espruino.com/Saving - when saving the contents of RAM (the default) Espruino saves the state of IO (digitalWrite/pinMode/etc) but not the state of PWM.

    Probably what you want is to call analogWrite(B4, 0.1); from a function called onInit, so that it is run automatically at boot.

  • in Interfacing
    Avatar for Gordon

    It's all updated now, so using disp.set without that extra bit of code I gave you should work fine :)

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gordon

    Hi,

    Windows 7 doesn't support Bluetooth LE in the OS. It may support Bluetooth, but it needs to be Bluetooth LE. If you managed to pair, chances are it was through some driver software provided by the Bluetooth radio manufacturer - that might handle Bluetooth LE keyboards, but it won't allow the Web IDE access to the device.

    So you need to allow the Espruino Native IDE to have full access to the Bluetooth radio itself, without going through windows. You have two options:

    • Disable Bluetooth in Windows by using Zadig to install the WinUSB driver for your built-in Bluetooth (not recommended, as you're disabling Bluetooth in Windows)
    • Get a Bluetooth LE USB dongle like recommended here and use zadig to configure it for use with WinUSB so the IDE can use it. You then get to keep the existing Bluetooth support in the Laptop.

    Windows 8.1 and later do have Bluetooth LE support in the OS, but I'm afraid Windows 7 doesn't. It was released 10 years ago - before the Bluetooth LE spec was released.

  • in Electronics
    Avatar for Gordon

    Ahh - using a geared motor and gravity makes a lot of sense. If you still had trouble with the new motor you could add a counter-weight I guess.

    I actually had a lot of success with a solar powered USB power bank. Sometimes you might not want to use the USB output directly (Espruino can draw so little power that some of them think nothing is connected and turn off), but it's usually trivial to crack them open and connect straight to the battery - and you've then got a really nice, convenient unit with loads of power.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for Gordon

    Ok, I just added support to the low-level library. Check out the examples there:

    http://www.espruino.com/NRF52LL

    While there aren't interrupts there directly you can still hook it up to do some pretty interesting things (eg counting changes in the input or accurately measuring the time between them). If you desperately need them you can always change the state of a pin, then short that to another pin that you can use with setWatch.

  • in Interfacing
    Avatar for Gordon

    any references I could take a look at to wrap my head around this concept?

    In the code above? Rather than printing for every frame, you just increment a counter. Then every second you print the value of that counter. If 30 frames were rendered in that second then it should print 30.

    If you're asking about the JS execution speed then http://www.espruino.com/Performance might help though

  • in Interfacing
    Avatar for Gordon

    I just tested that, and it's to be expected. Because of rounding, 99999999.1 ends up turning into 99999999.09999999403 when converted to a string with toString, and it's the last few digits that get shown.

    If you want full control over it, convert it to a string manually yourself and pass the string in - eg: disp.set((99999999.1).toFixed(1))

    I'll update the library with the new code :)

Actions