Avatar for HaraldK

HaraldK

Member since Sep 2015 • Last active May 2017
  • 3 conversations
  • 14 comments

Most recent activity

  • in General
    Avatar for HaraldK

    Nah, it's generally a problem and it seems to be because I'm in Japan.

  • in General
    Avatar for HaraldK

    PayPal for whatever odd reason, doesn't like donations when you (resp. me) are in Japan. So button or not, no donations from me. Instead I bought some Pucks from the Tindie store.

  • in Interfacing
    Avatar for HaraldK

    ROR is ROtate Right. ROL is ROtate Left.
    Difference to a normal shift is that in a shift all bits move one bit position. The leftmost in a shift left or rightmost in a shift right usually gets a 0.
    In a rotation the bits move in a circle: in a left shift bit 7 moves into bit 0.
    See here: en.wikipedia.org/wiki/Bitwise_opĀ­eration#Rotate_no_carry

  • in Electronics
    Avatar for HaraldK

    The LiPo is fine. The connectors too. The voltage (measured with a simple multimeter) is fine too.
    And I don't even have to touch anything. It reacts slightly by just nearing my hand near the LiPo.
    Which is why I think this is a capacitance thing, but I cannot explain this.

    What could make a WS2812 think that blue data should be sent to the red LED, and at high intensity (ike shifts 3 bits left)? Consistently.

  • in Electronics
    Avatar for HaraldK

    I got a nice STM32F4 Discovery board for quite a while. Recently installing Espruino (1v80) on it and having a significant amount of fun learning JavaScript. But now I got an electronical problem (unlikely Espruino, but maybe STM32 related):

    See here

    for what happens.

    Connections: STM32F4 board connecting to PC (for terminal) and a LiPo and switched regulator to the 5V input. B15 is connected via a jumper cable to Din of the WS2812 chain. GND too. Vcc of the LEDs is not using 5V as that gives me those high intensity colors I get too when I touch the LiPo. So I know that 3.3V is not sufficient to drive a 5V WS2812. Fine. No issue. I should drive it with 5V after all.

    The problem is that I'd like to understand the mechanism why when I touch the LiPo, the light intensity is reproduceable different. It's still working as sending data to the WS2812 still makes the lights move in circles. The colors change:
    Low intensity blue gets high intensity red. High intensity blue gets low intensity green.
    Low intensity red get high intensity green. High intensity red gets black.

    My understanding of R and C and transient spikes cannot explain this at all. The WS2812 is after all a digital device.

    Anyone an idea what happens?

    I know the fix is to drive the WS2812 with 5V, or drive them with 3.3V and have Vcc on the WS2812 get 3.3V (or less than 3.8V). That's not the problem. I'd like to understand why those LEDs behave odd when I touch the LiPo.

    • 6 comments
    • 413 views
  • in JavaScript
    Avatar for HaraldK

    Oh, now I got it! Of course you would pass the reference! Having one parameter made this pass-the-reference difficult or even impossible without using an anonymous function or the string of what to execute.

    Thanks a lot. I am now 1 step closer to understanding JavaScript ^_^

    • 16 comments
    • 665 views
  • in JavaScript
    Avatar for HaraldK

    Ok, I officially am a JS noob...thanks for the explanation. At first I did not see the difference, but I saw what to check.
    I kind'a get it now and this helped:

    var glow=function(led, stp) {
      var intensity=0;
      var dir=1.0;
      var this_led=led;
      var this_stp=stp;
      function intensity_step() {
        intensity+=dir*this_stp;
        if (intensity>=1.0) {
          intensity=1.0;
          dir=-dir;
        }
        if (intensity<=0.0) {
          intensity=0;
          dir=-dir;
        }
        analogWrite(this_led, intensity);
      }
      return intensity_step;
    };
    
    var led1=glow(D13,0.01);
    setInterval(led1, 2);
    

    Is that behavior a generic JS thing or the implementation of setInterval()?

Actions