Avatar for Mrbbp

Mrbbp

Member since Mar 2017 • Last active Sep 2017
  • 8 conversations
  • 48 comments

I'm newb with espruino, not with arduino, not with js...
But i'm not a coding ninja

Most recent activity

  • in Interfacing
    Avatar for Mrbbp

    @allObjects: Whao, i'm impressed! Amazing!
    Have to take time to test your code.
    Thanks for the great explanation.
    I've got the version with the silkscreen error on pcb (inverted LAT and 5V pins).
    Sorry i just understand the use of espruino spi.write() - data,clk, latch pins

    @Gordon, sorry, i've forgotted to write: i use a pico board unpinned.

    The arduino lib is great but for english writer, no accents! :/
    Want to combine with the custom font of espruino.

  • in Interfacing
    Avatar for Mrbbp

    If i power the espruino with the 12v, i plug on the 3rd pin (gnd pin side)?
    Apologies for this basic question, but the page is not lighting for my english abilities 😞

  • in Interfacing
    Avatar for Mrbbp

    There is 2 ic 74hc238 who are decoding a 3bit adress and convert to 8bits for the shift register 74hc595 (i suppose) for l293d
    I do not have direct access to shift register.
    But perhaps i'm wrong on the way that's works.
    Or in a different way.
    The 595 is a stronger version of standard shift register...

    Here the git page of the project (lib and diagramm)

    In the arduino lib, the latch time is 500 microseconds.
    I've tried with more time but no better results...

    An other question who is alway confuse me on the espruino.
    I want to use the usb for debugging purpose,
    The display is powered in 12v and convert a line to 5v to power the mcu.
    i need to power the espruino from this line.
    On which pin do i need to clip the power (i'm not soldering at the moment)
    On the pin near the gnd one or the next pin (third) or on the ViN pin?
    I'm sad cause i've burned two display with an incorrect power connection when changing clip position from the mcu.
    Regards

  • in Interfacing
    Avatar for Mrbbp

    Hello @Gordon

    I've bought a flipdot display controled by a shift register.
    There is an arduino lib to control it...
    i find the code to display one pixel with arduino:

    void FlipDot_5x7::displayPixel(int16_t x, int16_t y, boolean color) {
        if (x < FLIPDOT_MODULE_WIDTH && y < FLIPDOT_MODULE_HEIGHT) {
            // DR R0 R1 R2 DC C0 C1 C2
            uint8_t data = color != _invert;
            data |= y << 1;
            data |= (color == _invert) << 4;
            data |=  x << 5;
            shiftOut(_data, _clock, LSBFIRST, data);
        }
    }
    

    it needs a LATCH pin more for working, i've added it in the js code
    i've rewrited the code for espruino like this

    var DATA_PIN = A8;
    var CLOCK_PIN = B6;
    var LATCH_PIN = B4;
    var compteur=0;
    var aff= 0;
    
    var FLIPDOT_MODULE_WIDTH = 5;
    var FLIPDOT_MODULE_HEIGHT = 7;
    var _invert = false;
    
    function displayPixel(x, y, color) {
        if (x < FLIPDOT_MODULE_WIDTH && y < FLIPDOT_MODULE_HEIGHT) {
            // DR R0 R1 R2 DC C0 C1 C2
            var data = color != _invert;
            data |= y << 1;
            data |= (color == _invert) << 4;
            data |=  x << 5;
            shiftOut(DATA_PIN, {clk:CLOCK_PIN}, data);
            //console.log("data:", data.toString(2));
        }
      console.log("x,y,c:",x,y,color);
      
    }
    
    function onInit() {
      setInterval(function() {
        digitalPulse(LATCH_PIN,1,1);
        displayPixel(aff%5, Math.floor(aff/5)%7, compteur%2);
        LED1.toggle();
        compteur ++;
        if (compteur%2 ===0) {aff++;}
      }, 500);
    }
    

    it does not work...
    if i generate a random number for data

    data = Math.round(Math.random()*255);
    

    dots flip sometime...
    i suppose it's about format of my byte...

    Luca from Hannio send me the format for the byte

    the data has to be xxxCyyyc where xxx is the binary representation of
    the x coord (and yyy for the y). c is the color, C is the inverted
    value. Thus, for example, x = 2, y = 3, c = 1 would be 010 0 011 1.

    Where i'm wrong?

    best regards

    é.

    • 35 comments
    • 478 views
  • in Interfacing
    Avatar for Mrbbp

    Controller back in stock !!!

  • in Interfacing
    Avatar for Mrbbp

    I've bought it...😎
    I'm in vacation til mid august...
    I'll try when back home

  • in JavaScript
    Avatar for Mrbbp

    @Gordon oups, you're rigth.
    It's a bad cut/past.
    I've modifying the code
    Thanks

    • 5 comments
    • 160 views
Actions