UT-L 7-Seg R Click Board
UT-L 7-Seg R Click Board
Add a double 7 segment display to your next project.
The UT-L 7-Seg R Click Board™ carries two SMD ultra-thin LED 7-SEG displays and the MAX6969 constant-current LED driver from Maxim Integrated. The Click Board™ is designed to run on either a 3.3V or 5V power supply. It communicates with the target microcontroller over the SPI interface.
Software Support
Code examples for the UT-L 7-Seg R Click Board™, written for MikroElektronika hardware and compilers are available on Libstock.
CODE SNIPPET
The following code snippet counts down from 99 to 0 on the displays of the UT-L 7-Seg R Click Board™.
01 sbit MAX6969_LE_PIN at RC2_bit; 02 sbit MAX6969_LE_PIN_Direction at TRISC2_bit; 03 04 uint16_t pwmPeriod; 05 static const uint8_t minus_char = 0x40; 06 07 void systemInit() 08 { 09 AD1PCFG = 0xFFFF; 10 MAX6969_LE_PIN_Direction = 0; 11 SPI3_Init(); 12 pwmPeriod = PWM_Init(5000, 1, 1, 2); 13 PWM_Start(1); 14 PWM_Set_Duty(pwmPeriod/10, 1); 15 16 } 17 18 void MAX6969_Chip_Select() 19 { 20 MAX6969_LE_PIN = 1; 21 asm nop 22 asm nop 23 asm nop 24 MAX6969_LE_PIN = 0; 25 } 26 27 static void U7SEG_Write(uint8_t number) 28 { 29 char numbers[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; 30 uint8_t tens = number / 10; 31 uint8_t ones = number % 10; 32 if (number > 99) return; 33 34 SPI_Wr_Ptr(numbers[ones]); 35 SPI_Wr_Ptr(numbers[tens]); 36 } 37 38 void main() 39 { 40 uint8_t counter; 41 42 systemInit(); 43 counter = 100; 44 45 while(counter--) 46 { 47 U7SEG_Write(counter); 48 MAX6969_Chip_Select(); 49 Delay_ms(500); 50 } 51 52 SPI_Wr_Ptr(minus_char); 53 SPI_Wr_Ptr(minus_char); 54 MAX6969_Chip_Select(); 55 }
UT-L 7-Seg R Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.