![]() |
Forum Index : Microcontroller and PC projects : uMite clock with mp3 sound
Author | Message | ||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
Just a quick project... Friend wanted clock with Tibetan bells on certain time markers. Here is uMite with adafruit 7 segment LED 1.2" display (I2C), olimex mod rtc (will be switching to ds3231 for better accuracy), MDfly mp3 module for sound, serial connection, single encoder with push button for menu, time, sound, volume, etc. settings. The large lcd will not be part of this project, I just wanted to show this as it is a great deal from Jameco or Ebay. It is an extra large 2002 display for about $5.00 ea. The lcd below it is a 1602 for size comparison. Could be good for a few projects, especially at that price. Just having some fun with uMite. Thanks again Geoff and forum members for all your help once again! ![]() |
||||
halldave![]() Senior Member ![]() Joined: 04/05/2014 Location: AustraliaPosts: 121 |
This looks pretty cool. do you have any sample code to share how you drove the seven segment through i2c? regards David |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
Hi David, Here is basic code for time clock using this adafruit display. 'ADAFRUIT 1.2" SEVEN SEGMENT LED DISPLAY ON I2C 'USES HT16K33 RAM Mapping 16*8 LED Controller Driver with keyscan 'http://www.adafruit.com/datasheets/ht16K33v110.pdf 'BASIC DISPLAY CURRENT TIME PROGRAM 'RTC IS OLIMEX MOD RTC ON I2C 'THE BACK SHED - VISCOMJIM DIM T(10) T(0)=&H3F:T(1)=&H06:T(2)=&H5B:T(3)=&H4F:T(4)=&H66 'SEGMENT DATA FOR 0 - 4 T(5)=&H6D:T(6)=&H7D:T(7)=&H07:T(8)=&H7F:T(9)=&H6F 'SEGMENT DATA FOR 5 - 9 I2C OPEN 100,100 'OPEN I2C PORT I2C WRITE &H70, 0, 1, &H21 'START OSC. ON DISPLAY - &H70 DEFAULT ADDRESS I2C WRITE &H70, 0, 1, &H81 'BLINK OFF - DISPLAY ON I2C WRITE &H70, 0, 1, &HEF 'BRIGHTNESS FULL ON (E0 DIM - EF BRIGHTEST) COL=0 'COLON SETTICK 500, FLASH 'SWITCH COLON ON AND OFF 1 PER SECOND SETTICK 3600000, SETTIME, 4 'RESET uMITE CLOCK USING RTC EVERY HOUR RTC GETTIME 'SET uMITE CLOCK NOW DO HRSTENS=Val(Left$(Time$,1)) 'GET 10 HOUR DIGIT HRSONES=VAL(MID$(TIME$,2,1)) 'GET 1 HOUR DIGIT MINTENS=Val(Mid$(Time$,4,1)) 'GET 10 MIN DIGIT MINONES=Val(Mid$(Time$,5,1)) 'GET 1 MIN DIGIT I2C WRITE &H70, 0, 2, &H00, T(HRSTENS) 'WRITE 10 HOUR DIGIT I2C WRITE &H70, 0, 2, &H02, T(HRSONES) 'WRITE 1 HOUR DIGIT I2C WRITE &H70, 0, 2, &H06, T(MINTENS) 'WRITE 10 MIN DIGIT I2C WRITE &H70, 0, 2, &H08, T(MINONES) 'WRITE 1 MIN DIGIT LOOP SETTIME: RTC GETTIME IRETURN FLASH: IF COL = 0 THEN DOT = &H00 IF COL = 1 THEN DOT = &H02 I2C WRITE &H70, 0, 2, &H04,DOT IF COL = 1 THEN COL = 0 ELSE COL = 1 'FLIP COL ON OR OFF ENDIF IRETURN |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9643 |
Nice work, Jim. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
Thank you Grogster. Adafruit has some really cool products, however, if you are not using arduino, raspberry pi, or beagle bone black, where they supply the library for their parts, its like pulling teeth to figure out how to get some of their products running. Between trying to port their libraries and deciphering the data sheets, one can get there, but its certainly not super fun. |
||||
BobD![]() Guru ![]() Joined: 07/12/2011 Location: AustraliaPosts: 935 |
They do have some interesting gear with the HT16K33. I like this one and the chip has the ability to support a custom keyboard. |
||||
shellgray Newbie ![]() Joined: 04/06/2014 Location: AustraliaPosts: 4 |
Hi Jim i bought an Adafruit 7 segment LED 1.2" display but when i hook the 5 volt supply from my Maximite to the display i2c communication stops. I assumed the display draws to much current for my maximite to handle. Do you have a seperate 5 volt power supply to your 7 segment LED 1.2" display i cant tell from the photos. Thank you. Graham ![]() |
||||
viscomjim Guru ![]() Joined: 08/01/2014 Location: United StatesPosts: 925 |
Hi Graham, I did power it with a separate power supply. I did not use the Maximite however, so you might have to make a few changes in the code. I did start with the Maximite back in the day, but now I do everything with the micromite, including this project. I am sure you can adapt the code to make it work. Good luck and let us know how you make out. Also, welcome to the forum!!!!! |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
@shellgray; When driving these 7-seg/matrix displays, I find it best to use a separate psu. The 8x8 matrix I am driving at the moment can peak at 350mA requirment (when at max brightness). Also, just to check, you cant drive the segments directlly from a Mite's pin; you will need a 'driver' to deliver enough current. I typically use a MOSFET (2n7000/2) with gate to PIC (via a 470ohm resistor), source to GND, and drain is then the switched GND to the LED. Use a P-channel if wanting to switch high side. Hope you get on ok - any more help you require then simply post your 'issue' here. There's enough people on this forum that will be willing to help you. . . . WW |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |