hatamiarash7
Posts: 1
Joined: Mon Apr 11, 2016 7:29 am

I2C Address , 7-segment

Mon Apr 11, 2016 7:37 am

hi
i have a 4-digit seven segment module and i have something like this for

Code: Select all

i2cdetect -y 1
. how can i write a simple program ??? which one is my true address ? :cry: :cry: :cry: :cry: :?: :?: :?: :?:

0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- 24 25 26 27 -- -- -- -- -- -- -- --
30: -- -- -- -- 34 35 36 37 -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: I2C Address , 7-segment

Sun Apr 17, 2016 4:39 am

Without at least a description of how you are interfacing the 7 segment display to the I2C bus, of at least the device's number, no one can help you.

Personally I would use multiple BCD to 7 segment drivers and a MCP23017 to drive the display. It makes life a lot easier. Write a 8 and "8" is displayed. Depending on the driver chip, Hex (A-F/a-f) can also be displayed.

Additionally a single MCP23017 could handle the interfacing needs for all four digits of your 7 segment display.

Now if your display has a native I2C interface, then you don't need the MCP23017 or the BSD decoder chips. You are going to have to decipher the display's data sheet. I suspect that each digit would have it's own address on the I2C bus. Why you have 8 addresses showing is a mystery. Check the display's wiring. Leave no lines open.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

User avatar
brekee12
Posts: 335
Joined: Wed Feb 03, 2016 3:36 pm
Location: HU

Re: I2C Address , 7-segment

Sun Apr 17, 2016 8:10 am

Do not forget about the 0 bit which is RW. You can see addresses which should be used in your program. If you like you can convert the addresses as you want taking consideration this RW bit.
Brekee12
on a Raspberry B+ with whezzy, two Zero with Jessie Light

User avatar
DougieLawson
Posts: 35796
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: I2C Address , 7-segment

Sun Apr 17, 2016 2:12 pm

Richard-TX wrote: Personally I would use multiple BCD to 7 segment drivers and a MCP23017 to drive the display. It makes life a lot easier. Write a 8 and "8" is displayed. Depending on the driver chip, Hex (A-F/a-f) can also be displayed.
Personally I'd use a MAX7219 which is available from eBay for less than a fiver
http://www.ebay.co.uk/itm/MAX7219-LED-M ... 1894486431
and has a ready to run library https://github.com/rm-hull/max7219

It's SPI, but works really well on my RPiZ.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Interfacing (DSI, CSI, I2C, etc.)”