Arduino and Tm1638 button example

This code snippet will get the button value and display the value on the 7 Segment LED and the LEDs

TM1638 Chip Key Display Module

Code

[c]

#include <TM1638.h>
// define a module on data pin 8, clock pin 9 and strobe pin 10
TM1638 module(8, 9, 10);

byte buttons;
void setup()
{
}

void loop()
{
//get the button
//S1 = 1, S2 = 2, S3 = 4, S4 = 8
//S5 = 16, S6 = 32, S7 = 64, S8 = 128
buttons=module.getButtons();
module.setDisplayToDecNumber(buttons,0,false);
module.setLEDs(buttons);
}

[/c]

Related posts

Arduino Uno and PCT2075 temperature sensor

Arduino Uno and AHT20 Integrated temperature and humidity Sensor

Arduino Uno and LTR390 UV Light Sensor

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More