SlideShare a Scribd company logo
int latchPin = 13;//ST_CP 
int clockPin = 12;//SH_CP 
int dataPin = 11; //DS 
// define latch, clock and datapin 
void setup () 
{ 
pinMode(latchPin,OUTPUT); 
pinMode(clockPin,OUTPUT); 
pinMode(dataPin,OUTPUT); 
//set these three pins to output 
} 
//Display function (display word, display position, display if have 
//decimal point) 
void disNum(int Num_Qua, int Num_Pos, int Num_Dec) 
{ 
int Num_Qua_B = 0; 
int Num_Pos_B = 0; 
switch (Num_Qua) 
{ 
case 0:Num_Qua_B = 192;break; 
case 1:Num_Qua_B = 249;break; 
case 2:Num_Qua_B = 164;break; 
case 3:Num_Qua_B = 176;break; 
case 4:Num_Qua_B = 153;break; 
case 5:Num_Qua_B = 146;break; 
case 6:Num_Qua_B = 130;break; 
case 7:Num_Qua_B = 248;break;
case 8:Num_Qua_B = 128;break; 
case 9:Num_Qua_B = 144;break; 
default: Num_Qua_B = 255;break; 
}; 
//this value convert to binary, which is adcdefg need to light up 
switch (Num_Pos) 
{ 
case 1:Num_Pos_B = 1;break; 
case 2:Num_Pos_B = 2;break; 
case 3:Num_Pos_B = 4;break; 
case 4:Num_Pos_B = 8;break; 
case 5:Num_Pos_B = 16;break; 
case 6:Num_Pos_B = 32;break; 
case 7:Num_Pos_B = 64;break; 
case 8:Num_Pos_B = 128;break; 
default: Num_Pos_B = 0;break; 
}; 
//this value convert to binary, which is the one light up now. 
if (Num_Dec == 1) 
{ 
Num_Qua_B = Num_Qua_B + 128; 
}; 
//======================================== 
digitalWrite(latchPin,LOW); 
// set latch to low tolet the display ready to receive data 
int L = Num_Qua_B; int R = Num_Pos_B; 
shiftOut(dataPin,clockPin,MSBFIRST,R); 
shiftOut(dataPin,clockPin,MSBFIRST,L);
digitalWrite(latchPin,HIGH); //restore to high TTL back 
//======================================== 
delayMicroseconds(100); 
} 
//this is the display number function 
void showNum(double number) 
// use double instead of int, int is not longer enough 
{ 
long num = number; 
int ShowDec [8]; 
for (int x = 1; x < 9; x++) 
{ 
ShowDec [x] = 0; 
} 
//creat the array for decimal point, 0 is not to display, 1 is to display 
if (num < 10000000){ 
if (num < 1000000){num = number*100; ShowDec[6]=1;ShowDec[7]=0;} 
else{ 
num = number*10; ShowDec[7]=1; 
} 
} 
//simple decimal point for two number display 
int ShowNumber [8]; 
ShowNumber[1] = (num/10000000)%10; 
ShowNumber[2]= (num/1000000)%10;
ShowNumber[3] = (num/100000)%10; 
ShowNumber[4] = (num/10000)%10; 
ShowNumber[5] = (num/1000)%10; 
ShowNumber[6] = (num/100)%10; 
ShowNumber[7] = (num/10)%10; 
ShowNumber[8]= (num/1)%10; 
//get every number and store in the arrary 
int dectest = 0; 
for (int x = 1; x<8; x++) 
{ 
if ((dectest == 0)and(ShowNumber[x] == 0)) 
{ 
ShowNumber[x] = 11; 
} 
else 
{ 
dectest = 1; 
} 
} 
//check if there is a "0" on the left front, if yes we ignore it 
disNum(ShowNumber[1],1,ShowDec[1]); 
disNum(ShowNumber[2],2,ShowDec[2]); 
disNum(ShowNumber[3],3,ShowDec[3]); 
disNum(ShowNumber[4],4,ShowDec[4]);
disNum(ShowNumber[5],5,ShowDec[5]); 
disNum(ShowNumber[6],6,ShowDec[6]); 
disNum(ShowNumber[7],7,ShowDec[7]); 
disNum(ShowNumber[8],8,ShowDec[8]); 
//display number in sequency, flashing fast 
} 
void loop() 
{ 
showNum(80600000);//simple function to display to number 
}

More Related Content

What's hot

C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
Chris Ohk
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
Wataru Kani
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
Chris Ohk
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -
Wataru Kani
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examplesmua99
 
C tech questions
C tech questionsC tech questions
C tech questions
vijay00791
 
Questions typedef and macros
Questions typedef and macrosQuestions typedef and macros
Questions typedef and macros
Mohammed Sikander
 
C++ Question on References and Function Overloading
C++ Question on References and Function OverloadingC++ Question on References and Function Overloading
C++ Question on References and Function Overloading
mohamed sikander
 
Langrange method for MATLAB Code
Langrange method for MATLAB CodeLangrange method for MATLAB Code
Langrange method for MATLAB Code
Taimoor Muzaffar Gondal
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
Abhranil Das
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
Farhan Ab Rahman
 
Teeing Up Python - Code Golf
Teeing Up Python - Code GolfTeeing Up Python - Code Golf
Teeing Up Python - Code Golf
Yelp Engineering
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString Manipulation Function and Header File Functions
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings
Sylvain Hallé
 
C programming pointer
C  programming pointerC  programming pointer
C programming pointer
argusacademy
 
CS50 Lecture3
CS50 Lecture3CS50 Lecture3
CS50 Lecture3
昀 李
 
Nesting of for loops using C++
Nesting of for loops using C++Nesting of for loops using C++
Nesting of for loops using C++
prashant_sainii
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2Amit Kapoor
 

What's hot (20)

C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examples
 
C tech questions
C tech questionsC tech questions
C tech questions
 
Questions typedef and macros
Questions typedef and macrosQuestions typedef and macros
Questions typedef and macros
 
C++ Question on References and Function Overloading
C++ Question on References and Function OverloadingC++ Question on References and Function Overloading
C++ Question on References and Function Overloading
 
Langrange method for MATLAB Code
Langrange method for MATLAB CodeLangrange method for MATLAB Code
Langrange method for MATLAB Code
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
 
week-10x
week-10xweek-10x
week-10x
 
Teeing Up Python - Code Golf
Teeing Up Python - Code GolfTeeing Up Python - Code Golf
Teeing Up Python - Code Golf
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
 
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings
 
C programming pointer
C  programming pointerC  programming pointer
C programming pointer
 
C++ programming
C++ programmingC++ programming
C++ programming
 
CS50 Lecture3
CS50 Lecture3CS50 Lecture3
CS50 Lecture3
 
Nesting of for loops using C++
Nesting of for loops using C++Nesting of for loops using C++
Nesting of for loops using C++
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
 

Viewers also liked

Carta Universal Derechos Humanos
Carta Universal Derechos HumanosCarta Universal Derechos Humanos
Carta Universal Derechos Humanos
Alex Vogager
 
Crisis in mexico Enrique Peña Nieto, and mexico's infrarrealistas
Crisis in mexico  Enrique Peña Nieto, and mexico's infrarrealistasCrisis in mexico  Enrique Peña Nieto, and mexico's infrarrealistas
Crisis in mexico Enrique Peña Nieto, and mexico's infrarrealistas
Alex Vogager
 
Desapariciones Forzadas Reporte HRW México
Desapariciones Forzadas Reporte HRW MéxicoDesapariciones Forzadas Reporte HRW México
Desapariciones Forzadas Reporte HRW México
Alex Vogager
 
Riset pandangan pengguna iOS terhadap cydia jailbreak
Riset pandangan pengguna iOS terhadap cydia jailbreakRiset pandangan pengguna iOS terhadap cydia jailbreak
Riset pandangan pengguna iOS terhadap cydia jailbreak
Research Assistant - Statistical Modeling on Apps
 
البحث النهائي لمبادئ التكوين
البحث النهائي لمبادئ التكوينالبحث النهائي لمبادئ التكوين
البحث النهائي لمبادئ التكوين
YEMENI JORDANIAN UNIVERSITY
 
Apresentaoodicialm 140918223638-phpapp02
Apresentaoodicialm 140918223638-phpapp02Apresentaoodicialm 140918223638-phpapp02
Apresentaoodicialm 140918223638-phpapp02Sergio Silva
 
計数感覚養成講座紹介パワポ
計数感覚養成講座紹介パワポ計数感覚養成講座紹介パワポ
計数感覚養成講座紹介パワポ
sasataku_0929
 
Elisa tunnistus
Elisa tunnistusElisa tunnistus
Elisa tunnistus
Petteri Ihalainen
 
計数感覚養成講座紹介パワポ
計数感覚養成講座紹介パワポ計数感覚養成講座紹介パワポ
計数感覚養成講座紹介パワポsasataku_0929
 
Lcr 800 user manual (1)
Lcr 800 user manual (1)Lcr 800 user manual (1)
Lcr 800 user manual (1)
Slim Abid
 
Research study on dyslexia provision in the European workplace
 Research study on dyslexia provision in the European workplace Research study on dyslexia provision in the European workplace
Research study on dyslexia provision in the European workplace
Jan Halfpenny MEd
 
Dyslexia Plus - 3 common processing differences that commonly occur with dysl...
Dyslexia Plus - 3 common processing differences that commonly occur with dysl...Dyslexia Plus - 3 common processing differences that commonly occur with dysl...
Dyslexia Plus - 3 common processing differences that commonly occur with dysl...
Jan Halfpenny MEd
 
United Aquafarm Ventures Empire Franchise Package
United Aquafarm Ventures Empire Franchise PackageUnited Aquafarm Ventures Empire Franchise Package
United Aquafarm Ventures Empire Franchise Package
United Aquafarm Ventures Inc.
 
Mat.sunum 1
Mat.sunum 1Mat.sunum 1
Mat.sunum 1
gencnurhayat
 

Viewers also liked (14)

Carta Universal Derechos Humanos
Carta Universal Derechos HumanosCarta Universal Derechos Humanos
Carta Universal Derechos Humanos
 
Crisis in mexico Enrique Peña Nieto, and mexico's infrarrealistas
Crisis in mexico  Enrique Peña Nieto, and mexico's infrarrealistasCrisis in mexico  Enrique Peña Nieto, and mexico's infrarrealistas
Crisis in mexico Enrique Peña Nieto, and mexico's infrarrealistas
 
Desapariciones Forzadas Reporte HRW México
Desapariciones Forzadas Reporte HRW MéxicoDesapariciones Forzadas Reporte HRW México
Desapariciones Forzadas Reporte HRW México
 
Riset pandangan pengguna iOS terhadap cydia jailbreak
Riset pandangan pengguna iOS terhadap cydia jailbreakRiset pandangan pengguna iOS terhadap cydia jailbreak
Riset pandangan pengguna iOS terhadap cydia jailbreak
 
البحث النهائي لمبادئ التكوين
البحث النهائي لمبادئ التكوينالبحث النهائي لمبادئ التكوين
البحث النهائي لمبادئ التكوين
 
Apresentaoodicialm 140918223638-phpapp02
Apresentaoodicialm 140918223638-phpapp02Apresentaoodicialm 140918223638-phpapp02
Apresentaoodicialm 140918223638-phpapp02
 
計数感覚養成講座紹介パワポ
計数感覚養成講座紹介パワポ計数感覚養成講座紹介パワポ
計数感覚養成講座紹介パワポ
 
Elisa tunnistus
Elisa tunnistusElisa tunnistus
Elisa tunnistus
 
計数感覚養成講座紹介パワポ
計数感覚養成講座紹介パワポ計数感覚養成講座紹介パワポ
計数感覚養成講座紹介パワポ
 
Lcr 800 user manual (1)
Lcr 800 user manual (1)Lcr 800 user manual (1)
Lcr 800 user manual (1)
 
Research study on dyslexia provision in the European workplace
 Research study on dyslexia provision in the European workplace Research study on dyslexia provision in the European workplace
Research study on dyslexia provision in the European workplace
 
Dyslexia Plus - 3 common processing differences that commonly occur with dysl...
Dyslexia Plus - 3 common processing differences that commonly occur with dysl...Dyslexia Plus - 3 common processing differences that commonly occur with dysl...
Dyslexia Plus - 3 common processing differences that commonly occur with dysl...
 
United Aquafarm Ventures Empire Franchise Package
United Aquafarm Ventures Empire Franchise PackageUnited Aquafarm Ventures Empire Franchise Package
United Aquafarm Ventures Empire Franchise Package
 
Mat.sunum 1
Mat.sunum 1Mat.sunum 1
Mat.sunum 1
 

Similar to 7segment scetch

Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
SANTIAGO PABLO ALBERTO
 
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docxEJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
leovasquez17
 
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docxEJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
leovasquez17
 
sodapdf-converted into ppt presentation(1).pdf
sodapdf-converted into ppt presentation(1).pdfsodapdf-converted into ppt presentation(1).pdf
sodapdf-converted into ppt presentation(1).pdf
MuhammadMaazShaik
 
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
katherncarlyle
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
The IOT Academy
 
Arduino based keyboard and display interfacing
Arduino based keyboard and display interfacingArduino based keyboard and display interfacing
Arduino based keyboard and display interfacingAkash1900
 
DataTypes.ppt
DataTypes.pptDataTypes.ppt
DataTypes.ppt
RithikRaj25
 
C++ code only(Retrieve of Malik D., 2015, p. 742) Programming Exer.pdf
C++ code only(Retrieve of Malik D., 2015, p. 742) Programming Exer.pdfC++ code only(Retrieve of Malik D., 2015, p. 742) Programming Exer.pdf
C++ code only(Retrieve of Malik D., 2015, p. 742) Programming Exer.pdf
andreaplotner1
 
Lập trình C
Lập trình CLập trình C
Lập trình C
Viet NguyenHoang
 
Program flowchart
Program flowchartProgram flowchart
Program flowchart
Sowri Rajan
 
Please use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdfPlease use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdf
seoagam1
 
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + ProcessingRoberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
Demetrio Siragusa
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
Ismar Silveira
 
I am try to create a program that takes a user typed MIPS instructio.pdf
I am try to create a program that takes a user typed MIPS instructio.pdfI am try to create a program that takes a user typed MIPS instructio.pdf
I am try to create a program that takes a user typed MIPS instructio.pdf
allystraders
 
Effective C#
Effective C#Effective C#
Effective C#
lantoli
 
BScPLSQL.pdf
BScPLSQL.pdfBScPLSQL.pdf
BScPLSQL.pdf
DHANUSHTEJVUNNAM
 

Similar to 7segment scetch (20)

R tist
R tistR tist
R tist
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docxEJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
 
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docxEJERCICIOS DE BORLAND C++ 2DA PARTE.docx
EJERCICIOS DE BORLAND C++ 2DA PARTE.docx
 
sodapdf-converted into ppt presentation(1).pdf
sodapdf-converted into ppt presentation(1).pdfsodapdf-converted into ppt presentation(1).pdf
sodapdf-converted into ppt presentation(1).pdf
 
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
 
The IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programmingThe IoT Academy IoT Training Arduino Part 3 programming
The IoT Academy IoT Training Arduino Part 3 programming
 
Arduino based keyboard and display interfacing
Arduino based keyboard and display interfacingArduino based keyboard and display interfacing
Arduino based keyboard and display interfacing
 
Code
CodeCode
Code
 
DataTypes.ppt
DataTypes.pptDataTypes.ppt
DataTypes.ppt
 
C++ code only(Retrieve of Malik D., 2015, p. 742) Programming Exer.pdf
C++ code only(Retrieve of Malik D., 2015, p. 742) Programming Exer.pdfC++ code only(Retrieve of Malik D., 2015, p. 742) Programming Exer.pdf
C++ code only(Retrieve of Malik D., 2015, p. 742) Programming Exer.pdf
 
Lập trình C
Lập trình CLập trình C
Lập trình C
 
Program flowchart
Program flowchartProgram flowchart
Program flowchart
 
Please use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdfPlease use the code below and make it operate as one program- Notating.pdf
Please use the code below and make it operate as one program- Notating.pdf
 
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + ProcessingRoberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
 
I am try to create a program that takes a user typed MIPS instructio.pdf
I am try to create a program that takes a user typed MIPS instructio.pdfI am try to create a program that takes a user typed MIPS instructio.pdf
I am try to create a program that takes a user typed MIPS instructio.pdf
 
Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31
 
Effective C#
Effective C#Effective C#
Effective C#
 
BScPLSQL.pdf
BScPLSQL.pdfBScPLSQL.pdf
BScPLSQL.pdf
 

Recently uploaded

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 

Recently uploaded (20)

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 

7segment scetch

  • 1. int latchPin = 13;//ST_CP int clockPin = 12;//SH_CP int dataPin = 11; //DS // define latch, clock and datapin void setup () { pinMode(latchPin,OUTPUT); pinMode(clockPin,OUTPUT); pinMode(dataPin,OUTPUT); //set these three pins to output } //Display function (display word, display position, display if have //decimal point) void disNum(int Num_Qua, int Num_Pos, int Num_Dec) { int Num_Qua_B = 0; int Num_Pos_B = 0; switch (Num_Qua) { case 0:Num_Qua_B = 192;break; case 1:Num_Qua_B = 249;break; case 2:Num_Qua_B = 164;break; case 3:Num_Qua_B = 176;break; case 4:Num_Qua_B = 153;break; case 5:Num_Qua_B = 146;break; case 6:Num_Qua_B = 130;break; case 7:Num_Qua_B = 248;break;
  • 2. case 8:Num_Qua_B = 128;break; case 9:Num_Qua_B = 144;break; default: Num_Qua_B = 255;break; }; //this value convert to binary, which is adcdefg need to light up switch (Num_Pos) { case 1:Num_Pos_B = 1;break; case 2:Num_Pos_B = 2;break; case 3:Num_Pos_B = 4;break; case 4:Num_Pos_B = 8;break; case 5:Num_Pos_B = 16;break; case 6:Num_Pos_B = 32;break; case 7:Num_Pos_B = 64;break; case 8:Num_Pos_B = 128;break; default: Num_Pos_B = 0;break; }; //this value convert to binary, which is the one light up now. if (Num_Dec == 1) { Num_Qua_B = Num_Qua_B + 128; }; //======================================== digitalWrite(latchPin,LOW); // set latch to low tolet the display ready to receive data int L = Num_Qua_B; int R = Num_Pos_B; shiftOut(dataPin,clockPin,MSBFIRST,R); shiftOut(dataPin,clockPin,MSBFIRST,L);
  • 3. digitalWrite(latchPin,HIGH); //restore to high TTL back //======================================== delayMicroseconds(100); } //this is the display number function void showNum(double number) // use double instead of int, int is not longer enough { long num = number; int ShowDec [8]; for (int x = 1; x < 9; x++) { ShowDec [x] = 0; } //creat the array for decimal point, 0 is not to display, 1 is to display if (num < 10000000){ if (num < 1000000){num = number*100; ShowDec[6]=1;ShowDec[7]=0;} else{ num = number*10; ShowDec[7]=1; } } //simple decimal point for two number display int ShowNumber [8]; ShowNumber[1] = (num/10000000)%10; ShowNumber[2]= (num/1000000)%10;
  • 4. ShowNumber[3] = (num/100000)%10; ShowNumber[4] = (num/10000)%10; ShowNumber[5] = (num/1000)%10; ShowNumber[6] = (num/100)%10; ShowNumber[7] = (num/10)%10; ShowNumber[8]= (num/1)%10; //get every number and store in the arrary int dectest = 0; for (int x = 1; x<8; x++) { if ((dectest == 0)and(ShowNumber[x] == 0)) { ShowNumber[x] = 11; } else { dectest = 1; } } //check if there is a "0" on the left front, if yes we ignore it disNum(ShowNumber[1],1,ShowDec[1]); disNum(ShowNumber[2],2,ShowDec[2]); disNum(ShowNumber[3],3,ShowDec[3]); disNum(ShowNumber[4],4,ShowDec[4]);
  • 5. disNum(ShowNumber[5],5,ShowDec[5]); disNum(ShowNumber[6],6,ShowDec[6]); disNum(ShowNumber[7],7,ShowDec[7]); disNum(ShowNumber[8],8,ShowDec[8]); //display number in sequency, flashing fast } void loop() { showNum(80600000);//simple function to display to number }