SevenSegment_Array

SevenSegment_Array Library

Use it to easily display numbers on your seven segment display without any additional hardware. Supports common cathode and common anode displays. the use of switching transistors, for display numbers and decimal numbers. working with 1 to 6 digit display. Very useful and eggy library for all microcontrollers. Interfacing with 8051, 8052, PIC, PDK, AVR, N76E, STM8, MSP430 etc… 

How to define pins in MikroStudio for SevenSegment_Arrry library.
//#define _Seven_Segment_Timer_Disable // for disable timer ISR from SevenSegment_Array LIb
#define Seg_a  D,7 // segment a @ PORTD, BIT7
#define Seg_b  D,6 // segment a @ PORTD, BIT6
#define Seg_c  D,5 // segment a @ PORTD, BIT5
#define Seg_d  D,4 // segment a @ PORTD, BIT4
#define Seg_e  D,3 // segment a @ PORTD, BIT3
#define Seg_f  D,2 // segment a @ PORTD, BIT2
#define Seg_g  D,1 // segment a @ PORTD, BIT1
#define Seg_dp D,0 // segment dot @ PORTD, BIT0

#define Dig1 B,0       // for Digit1
#define Dig2 B,1       // for Digit2
#define Dig3 B,2       // for Digit3
#define Dig4 B,3       // for Digit4
#define SevSeg_4Digits // for total Digits like: SevSeg_1Digits | SevSeg_2Digits | SevSeg_3Digits | SevSeg_4Digits so on.
#define Common_anode   // for Common_anode | Common_cathode
Following functions can be used by this library.
  • Init_SevSeg_Array() // for initializing from HW_INI()
  • SevSegs_Display(int val) // for display Int value on display (numeric numbers)
  • SevSegs_Display_Float(float val)// for display float value on display (decimal numbers)
  • SevSegs_Frame_Loop() //Calling from Timer ISR optional if this library not work.
Note.

If this library is not working properly or gives warning like this #warning “Seven Segment Array library not able to start timer interrupt. So you can make time ISR and manually call the ‘SevSegs_Frame_Loop();'”. 

To do this first you have to disable the timer running in this library, so  define to these lines in your main project file.

  1. #define _Seven_Segment_Timer_Disable 
  2. #define __Seg_ok__ 

Now the timer is disabled. 

Then create an auto reload timer ISR in the main file and call the function (SevSegs_Frame_Loop();) from inside that ISR.  

Admin
Author: Admin

Leave a Reply