Skip to content

Instantly share code, notes, and snippets.

@RobolinkAkademi
Last active October 28, 2019 07:20
Show Gist options
  • Save RobolinkAkademi/089a47018e561c4c0fc8f5f0409bd8cd to your computer and use it in GitHub Desktop.
Save RobolinkAkademi/089a47018e561c4c0fc8f5f0409bd8cd to your computer and use it in GitHub Desktop.
tum_yil_icin_arduino_mufredati_27
#include "LedControl.h"
int DIN = 5;
int CS = 4;
int CLK = 3;
int Sound_Out=9;
byte gulumseyen[8]= {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C};
byte uzgun[8]= {0x3C,0x42,0xA5,0x81,0x99,0xA5,0x42,0x3C};
LedControl lc=LedControl(DIN,CLK,CS,0);
void setup(){
pinMode(Sound_Out,INPUT);
lc.shutdown(0,false); //Max72xx açılır
lc.setIntensity(0,1); // parklaklıhı ayarlar
lc.clearDisplay(0); // ekranı temizler
Serial.begin(9600);
}
void loop(){
if(digitalRead(Sound_Out)==1)
{
printByte(gulumseyen);
Serial.print("Ses yok");
delay(100);
}
else
{
printByte(uzgun);
Serial.print("Ses var");
delay(5000);
}
}
void printByte(byte character [])
{
int i = 0;
for(i=0;i<8;i++)
{
lc.setRow(0,i,character[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment