Avatar for ramzy23

ramzy23

Member since Jan 2024 • Last active Jan 2025
  • 3 conversations
  • 8 comments

I'm just an embedded systems engineer fooling around with some crazy equipment!

Most recent activity

  • in Bangle.js
    Avatar for ramzy23

    Hi all,

    Hope you are doing well. I bought myself a BangleJS2 over a year ago with the goal of writing my own app and finally I have gotten to it! I'm not a JS dev in any respects so, I'm quite new to the language in a manner of speaking but have been quite exposed to languages like C and Python so can get my way round the basic syntax e.t.c.

    I have been trying to use the WebIDE to get an app going and have been working on a function to draw arcs, which I hope to upstream to the main repo, but have met a few hiccups along the way. For a start, I wrote this app in Javascript, and have it as follows:

    function deg_to_rad(deg){
      return deg * PI / 180;
    }
    
    function drawArc(cx, cy, x, y, t, col) {
      const dt = 0.01;
    
      let radius = Math.sqrt(Math.pow(cx-x,2) + Math.pow(cy-y,2));
    
      let start_angle = Math.atan2(y - cy, x - cx);
      let end_angle = start_angle + deg_to_rad(t);
    
      for (let angle = start_angle; angle < end_angle; angle += dt ) {
          let x_cord = parseInt(radius * Math.cos(angle));
          let y_cord = parseInt(radius * Math.sin(angle));
    
          g.setPixel(x_cord + cx, y_cord + cy, col);
      }
    }
    

    So with that in mind, here is what I have done with it, to test it out - every so often, I increment one of 3 counters which will increase the radius of the arc drawn (watch video for what I mean). You will notice that at some point, the drawing starts t stutter. I'd love to know why this is the case, and how I could avoid this? (Oh, I'm working on a line thickness feature, hence why there are two lines per point). I'd also appreciate some input on the value for dt to use given it's in radians (and Pi is quite the relatively small number)

    I am wondering if the JS version of this will perform worse than the C version of this function. I'm just finishing up the last bits before posting a PR in the Espruino repository but don't yet know how to test this code on my device. I'm also trying to get some form of a local dev environment going to test out this code. Any advice or help on this issue would be greatly appreciated.

    • 9 comments
    • 598 views
  • in Bangle.js
    Avatar for ramzy23

    @Ganblejs I tried to install the nightly on my phone and that doesn't seem to install at all! Must be linked with having an Android operating system but I'm not too stressed about that. I beleive I can build the app myself and target my specific device - I could also just wait for the App Store update as @Gordon mentioned as well.

  • in Bangle.js
    Avatar for ramzy23

    Cool thanks for that update! Hopefully not much longer then!

  • in Bangle.js
    Avatar for ramzy23

    @Gordon Thanks for the link. I had done this a while back and I just did it again (double checking everything) and still observing the same behavior unfortunatly. I am thinking that it's linked with Gadgetbridge based on @Ganblejs's response above.

  • in Bangle.js
    Avatar for ramzy23

    Hi everyone,
    I have observed a weird issue where my Bangle JS 2 doesn't automattically connect and sync with Gadgetbridge on my phone. To be honest, this started a while back when going from v2.18 to v2.19/v2.20. I always have to go into GB and re-connecting my device to the app. I'm not sure why this is the case though and if anyone else experiences this. I am not sure if this is linked with my phone (Huawei p20 lite) or if it is linked with the watch itself. Any thoughts or previos threads I could look at? (I had a search and couldn't find anything similar)

    • 8 comments
    • 628 views
  • in Bangle.js
    Avatar for ramzy23

    Sorry, I closed this issue to soon when I got the first reply, so never got to end up replying. @Gordon, spot on with the DFU update! I was using the normal app loader (https://banglejs.com/apps/). Fortunatly I'm an Android user so no need to update I suppose but I did it anyway and it seemed to fix some other issues I was facing from prior to the update (2v18 to 2v19 but DFU stayed behind). I seemed to not be able to automatically connect to my phone back then but today it's been working fine since the FW and DFU update.

  • in Bangle.js
    Avatar for ramzy23

    Hi all,
    I seem to have an issue with my DFU version when having a look at my firmware version. I recall trying to find the correct DFU to upload but didn't find much. Also not sure how to update the bootloader. I'd love any assistance with this and the ability to know what's actually happening. I noticed this before and after updating to firmware 2v20 earlier today.

Actions