7Segment 4 Digit LED Module (5461AS) [D013]



https://www.youtube.com/watch?v=tf46Nr7TnTU


*GitHub : https://github.com/rdiot/rdiot-d013.git


* Contents

- DataSheet : http://deneb21.tistory.com/attachment/cfile24.uf@247A634855D713A025946C.pdf


- Connect

http://thomas.bibby.ie/wp-content/uploads/2015/10/KYX-5461AS-300x194.jpg


- Connect LM35

VCC - 5V

Output - A0

GND - GND


- Key Code

int sensorPin = 0;


//display pins

int segA = 5;

int segB = 13;

int segC = 10;

int segD = 8;

int segE = 7;

int segF = 4;

int segG = 11;

int segPt = 9;


int d1 = 6;

int d2 = 3;

int d3 = 2;

int d4 = 12;


int delayTime = 900;


int counter = 0;


float temperature = 77.7;


//only read temp every 100 cycles

if(counter%500 == 0)

{

  // read the pin

  int reading = analogRead(sensorPin);

  

  //convert reading to volts

  float volts = (reading * 5.0);

  volts /= 1024.0;


  temperature = volts * 100.0;


 counter = 0;

}


counter ++;


selectDigit(1);

sendDigit(tens(temperature));

delayMicroseconds(delayTime);


...

Posted by RD IoT RDIoT

댓글을 달아 주세요