Skip to content

ATmega2560 SMA420564 Display Driver. Support for Hexadecimal & Decimal values. Writes directly to pin ports

Notifications You must be signed in to change notification settings

matiasvlevi/SMA420564

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SMA420564 ATmega2560 Library

Display Hex, Decimal and Binary values on a 7 segment 4 digit display, using 12 pins.

I/O Config

Writes directly to ports, defaults are PORTA and PORTC on the ATmega2560 These ports can be changed in the header file.

I/O Config SMA420564
ATmega2560 Arduino Mega SMA42060 Label
PC0 37 2 dp
PC1 36 4 g
PC2 35 9 f
PC3 34 0 e
PC4 33 1 d
PC5 32 3 c
PC6 31 6 b
PC7 30 10 a
PA0 22 5 S4
PA1 23 7 S3
PA2 24 8 S2
PA3 25 11 S1


Library Usage

#include "SMA420564.h"

SMA420564 Display;

void setup(void) 
{
    /* ... code ... */
}

void loop(void)
{
    Display.write(1234);
    
    // Decimal values:
    //      Display.write(  9999, DEC);
    
    // Binary:
    //      Display.write(0b1010, BIN);
    
    // Hexadecimal values:
    //      Display.write(0xBEEF, HEX);
    //      Display.write(0xCAFE, HEX);

    // Enable display point, index ranges from 0 to 3
    //      Display.point(2);

    // Set display points in parrallel
    //      Display.set_points(0b0101);


    // Write raw data to ports:
    // you can refer to the static array `digits` which holds the raw bytes for the 16 symbols
    //      Display.write(0xFFFFFFFF, DEC, RAW); 
}


Clone this example:

git clone https://github.com/matiasvlevi/SMA420560.git ./playground

arduino-cli build

You can build with make which wraps the arduino-cli

Build:

make

Upload:

make upload

arduino-ide build

Open the cloned directory with arduino-ide Make sure the directory is named the same as the .ino file

About

ATmega2560 SMA420564 Display Driver. Support for Hexadecimal & Decimal values. Writes directly to pin ports

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published