Avatar for stweedo

stweedo

Member since Apr 2023 • Last active Jun 2024
  • 6 conversations
  • 76 comments

Most recent activity

  • in Bangle.js
    Avatar for stweedo

    No, I don't think it ever worked for me previously.

    I can confirm this newest version works though. Thank you!

  • in Bangle.js
    Avatar for stweedo

    I did some more digging and found that the following steps will allow time sync to work:

    1. Select the watch and then 'Forget This Device' from the Bluetooth settings on the iPhone.
    2. From the web IDE using the WebBLE app, connect to the Bangle but do not pair.
    3. Enter NRF.setServices({}, {cts: true}) into the console.
    4. Disconnect from within the web IDE and reconnect, but this time pair with iOS and allow notifications.

    After these steps it will update the boot code after switching between apps, and the time will then be synced. However, this only seems to last for one connection, and the whole process has to be done again if it's disconnected at all.

    I tried adding that NRF.setServices line into boot.js for the ios app, but it did not seem to help.

  • in Bangle.js
    Avatar for stweedo

    My time sync with iOS is not working either. It would appear CTS (Current Time Service) isn’t active on my phone because when I run ‘NRF.ctsGetTime()’ from the console it returns ‘Uncaught Error: CTS not active’.

    I’m using webBLE to connect to the bangle if that helps narrow down the problem.

    Thanks!

  • in Bangle.js
    Avatar for stweedo

    This is somewhat related… I recently switched to IOS from android and ever since I am missing the swipe feature you added with the green check mark and red X.

    Is this something that still needs to be implemented for iPhone users?

  • in Bangle.js
    Avatar for stweedo

    Yeah, I was using setClipRect as a mask essentially and layering the draws to create the animation.

    
    const SCREEN_WIDTH = g.getWidth();
    const SCREEN_HEIGHT = g.getHeight();
    const BOX_HEIGHT = 50;
    const NUMBER_SIZE = 30;
    const ANIMATION_DURATION = 3000;
    
    const BOX_DIMENSIONS = {
      left: 0,
      top: SCREEN_HEIGHT / 2 - BOX_HEIGHT / 2,
      width: SCREEN_WIDTH,
      height: BOX_HEIGHT
    };
    
    let numberValue = 0;
    let startTime = 0;
    let animationInterval;
    
    function setRect(method) {
      g[method](BOX_DIMENSIONS.left, BOX_DIMENSIONS.top, BOX_DIMENSIONS.width, BOX_DIMENSIONS.top + BOX_DIMENSIONS.height);
    }
    
    function drawNumber(yPosition, color) {
      g.setColor(color);
      g.setFont("Vector", NUMBER_SIZE);
      g.drawString(numberValue.toString(), SCREEN_WIDTH / 2 - g.stringWidth(numberValue.toString()) / 2, yPosition);
    }
    
    function animateNumber() {
      const now = Date.now();
      const progress = Math.min(1, (now - startTime) / ANIMATION_DURATION);
      g.clear();
    
      const currentY = (SCREEN_HEIGHT - NUMBER_SIZE) * progress;
    
      drawNumber(currentY, g.theme.fg);
    
      setRect('fillRect');
      setRect('setClipRect');
    
      drawNumber(currentY, g.theme.bg);
    
      g.setClipRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
      
      g.flip();
    
      if (progress < 1) {
        animationInterval = setTimeout(animateNumber, 1000 / 60);
      } else {
        numberValue = Math.floor(Math.random() * 100);
        startTime = Date.now();
        animationInterval = setTimeout(animateNumber, 500);
      }
    }
    
    startTime = Date.now();
    animateNumber();
    
    

    But it sounds like extending drawImages like you said could be way more versatile.

  • in Bangle.js
    Avatar for stweedo

    I was trying to implement something similar for a stop watch app except mine was a rectangle, not a circle, so I was able to use g.setClipRect.

    Maybe there could also be a g.setClipCircle?

  • in Bangle.js
    Avatar for stweedo

    Just chiming in about a similar issue I’ve experienced with my Bangle 2s. Both of my watches consistently display two identical scheduler apps in the ‘Installed’ section of the app loader, similar to what Tev described. Even after all the factory resets and firmware upgrades I’ve performed, these duplicate apps persist. Initially, I thought this was normal and speculated there could be a reason for having two of the same app.

Actions