• I would like to control 3 rows of 4-digit(with the decimal) 7-segment displays using i2c.
    The display that I would like to use can be found here: https://www.sparkfun.com/products/11408

    Is there a IC that exists to drive 3 rows of 7-segment display mentioned above using i2c?

  • Do you have to use I2C? You can use this chip:

    http://www.espruino.com/MAX7219

    On that page some modules are shown that include it already, but you can always wire up your own. It'll do brightness too.

    It uses 2 wire clock+data, so still 2 wires, but no pullups. You can then chain the modules end to end in order to have any number of LEDs.

    Also, because it's using SPI you can use 'soft SPI' which means you can use any two pins on Espruino for it.

  • i2c isnt neceassary, I can use spi. Thanks!

  • @Gordon I will most likely go the max7219 route. Just out of curiousity, how hard(code wise) would it be to implement:http://www.maximintegrated.com/en/produc­ts/power/display-power-control/MAX6955.h­tml ?

  • Well, that chip has a very rich feature set to write wrappers for, which makes a bigger job, if want expose the features, , but writing a for it probably wouldn't be that hard. What is hard, is justifying the price - digikey wants almost twenty five bucks a pop for them...

  • For 25 dollars I could probably purchase the max7219 chip with a 4 digit 7-segment display. I will stick with a max7219 chip and use multiples of them if need be.

  • @DrAzzy @Gordon I purchased one of these:https://www.adafruit.com/products/881 without doing research on the ht16k33 chip because I thought it would be relatively easy for me to port the arduino and python code to javascript, however I was wrong. After some more research I stumbled across:https://github.com/mdobson/tessel-ht16k3­3?files=1
    I haven't received the 7-segment from Adafruit yet so I wasn't able to attempt to port the code to the Espruino yet. Is the ht16k33 relatively easy to port over to the Espruino?

  • Datasheet doesn't make it look too bad. Only a handful of commands, and it doesn't look like it wants you to do any particularly weird stuff. Looks like the module'd be pretty easy to write.

    Writing off the top of my head looking at the datasheet, I'd start like

    
    exports.connect = function(i2c,address,) {
        return new HT16K33(i2c,range);
    }
    
    function HT16K33(i2c,address) {
      this.i2c = i2c;
      this.a=(address?address:0x70);
    }
    
    HT16K33.prototype.send = function(data){
        this.i2c.writeTo(this.a,0x00,data);
    }
    
    HT16K33.prototype.setBrightness = function(bright){
        this.i2c.writeTo(this.a,0xE0+E.clip(0,br­ight,16));
    }
    
    HT16K33.prototype.setDisplay = function(on,blink) { //blink - 0 = no blink, 1=2 blink per second, 2=1 blink per second, 3=1 blink per 2 second
        this.i2c.writeTo(this.a,0x80+(on?1:0)+(E­.clip(0,blink,3)<<1));
    }
    
  • Hi Gordon,
    I've been trying to control my 4 digit seven segment with ht16k33 back pack using Rpi and C codes i've found online (yeah, i'm a beginner and i don't really know how this works).
    Could you write a quick sample simple code that displays numbers on the 4 digit seven seg?
    Thanks

  • yeah thanks MaBe, but i haven't found a code in C for Rpi that works from all the resources i found through your link

  • there are two on github

  • I'm using a 4 digit seven segment; the code isn't compiling at all. no such file in directory is displayed as error. Isn't there any simple C code for Rpi to drive a 4 digit seven segment with the ht16k33 back pack......

  • I can't be much help - this is really a forum for the Espruino JavaScript interpreter.

    You could however compile that and run it - with the code above - on the Pi :) While I don't think hardware I2C is properly implemented, you could use software I2C on any GPIO pins.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

interface with 3 rows of 4 7-segment display using i2c?

Posted by Avatar for d0773d @d0773d

Actions