Avatar for Abhigkar


Member since Dec 2017 • Last active Apr 2020
  • 15 conversations

Love Esp

Most recent activity

  • in Other Boards
    Avatar for Abhigkar

    this is the Arduino code that I want to convert

  • in Other Boards
    Avatar for Abhigkar

    Thanks @allObjects for making me correct on my understanding. I am pretty much new to this type of architecture, and mostly worked on c#/ JavaScript web based application system. Electronics is my hobby and I like Esprunio because of its power and portability on embedded devices.

    My requirement is very very close to this there where Arduino code needs to be translated in JavaScript.

                while (digitalRead(clk) == LOW) {}

    The only change is the pin, which in my case is not CS but a normal Pin which is controlled by sensor, but still very close to my issue.
    And Gordon’s response

    The issue you're hitting is that setWatch timestamps the events and put them in a queue to execute with JS - but as you notice it's won't execute JavaScript in the interrupt itself.

    I will follow the thread and see if this help me.

  • in Other Boards
    Avatar for Abhigkar

    good to know!! @Robin Thanks

    Do you have any idea how to do read or write on I2C bus with this approach, i mean Inline C code makes a read/write calls to I2C ?

  • in Other Boards
    Avatar for Abhigkar

    RDY Pin which is something set by the sensor and keeps changing by IQS263 sensor. So MCU can request a I2C communication window when this pin goes down. That is the reason why while loop will not be an infinite.

    What my goal is to perform i2c read/write only when this PIN goes gown, that means I have to put some wait and poll the pin until it goes LOW.

    I see lots of implementation for this sensor in C/C++ where people set the falling interrupt on RDY pin and perform read/write.

    Since Espruino does not support interrupt directly [ here ]and setWatch callback only executes in main loop [ here ], I only see only option to setup the IRQ optionin setWatch and provide native calls to perform communication to sensor.

    Am I making things complicated here? Is there a simple approach available?

  • in Other Boards
    Avatar for Abhigkar

    I am interfacing Azoteq IQS263 Capacitive Touch sensor (Datasheet) with Espruino. The sensor is I2C interface with RDY line.

    As per the datasheet the device will response when RDY pin goes low. So I will have to wait and monitor when the RDY pin goes low to start and communication. Well in active this pin is bi-directional and communication windows opens when it is LOW and resumes sensing/calculating when it is HIGH.

    What should be the approach for this?
    1- While loop??

     while(rdyPin.read()){ //wait for the IQS to change from ready to not ready


    setWatch(watchFun, rdyPin, {repeat: true, edge: 'falling' });
  • in Bangle.js
    Avatar for Abhigkar

    A quick internet search gives me the fair uses or fair dealing (in UK) exceptions for copyright violations.

    Within the United Kingdom, fair dealing is a legal doctrine that provides an exception to the nation's copyright law in cases where the copyright infringement is for the purposes of non-commercial research or study, criticism or review, or for the reporting of current events.

    Does that sounds OKAY?

  • in Bangle.js
    Avatar for Abhigkar

    Scary, I never thought about this valid point.

  • in Bangle.js
    Avatar for Abhigkar

    I mean to get time from GPS.

    The clock get its time from GPS when started or re-started (bootloader.js)

    Bangle.on('GPS',function cb(g) {
          if (!g.time || (g.time.getFullYear()<2000) ||
             (g.time.getFullYear()==2250)) {
            // GPS receiver's time not set - just boot clock anyway
            eval(clockApp);delete clockApp;
          // We have a GPS time. Set time and reboot (to load alarms properly)

    Here g.time returns an time object in UTC, which I guess is fine.

    My assumption was the GPS will detect the location and convert the time to local timezone. But I may be wrong...

    Another though, can we have event emitter defined in bootloader.js that emit global events when-

    • A second elapsed
    • A minute elapsed
    • An hour elapsed

    Any app will subscribe to these events to process the clock time update.
    This way we don't have to write separate timers in clock app to capture the time update.

    what is "The GPS Time app"