Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>
- #include <LedControl.h>
- //www.elegoo.com
- //2016.12.9
- /*
- The circuit for lcd:
- * LCD RS pin to digital pin 7
- * LCD Enable pin to digital pin 8
- * LCD D4 pin to digital pin 9
- * LCD D5 pin to digital pin 10
- * LCD D6 pin to digital pin 11
- * LCD D7 pin to digital pin 12
- * LCD R/W pin to ground
- * LCD VSS pin to ground
- * LCD VCC pin to 5V
- * 10K resistor:
- * ends to +5V and ground
- * wiper to LCD VO pin (pin 3)
- The circuit for led matrix:
- pin 6 is connected to the DataIn
- pin 5 is connected to LOAD(CS)
- pin 4 is connected to the CLK
- */
- LedControl lc=LedControl(6,4,5,1);
- /* image switching time */
- unsigned long delaytime1=500;
- unsigned long delaytime2=50;
- // include the library code:
- // initialize the library with the numbers of the interface pins
- LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
- void setup() {
- // set up the LCD's number of columns and rows:
- lcd.begin(16, 2);
- //Matrix
- lc.shutdown(0,false);
- /* Set the brightness to a medium values */
- lc.setIntensity(0,0);
- /* and clear the display */
- lc.clearDisplay(0);
- }
- void writeArduinoOnMatrix() {
- /* here is the data for the characters */
- /* new by me */
- byte SMI[] = {B00000000,
- B01100110,
- B01100110,
- B00000000,
- B01000010,
- B01100110,
- B00111100,
- B00000000};
- displayCharacter(SMI);
- //clearMatrix();
- }
- void loop() {
- delay(2000);
- clearMatrix();
- // set the cursor to column 0, line 1
- // (note: line 1 is the second row, since counting begins with 0):
- lcd.setCursor(0, 0);
- //lcd.print("I love you!");
- writeArduinoOnMatrix();
- lcd.print("THANK YOU!");
- lcd.setCursor(0, 1);
- lcd.print(" ");
- delay(2000);
- clearMatrix();
- lcd.setCursor(0, 0);
- lcd.print("Gracious ");
- delay(500);
- lcd.setCursor(0, 1);
- lcd.print("Professionalism");
- }
- void displayCharacter(byte* Selected) {
- for (int i = 0; i < 8; i++) {
- lc.setRow(0,i,Selected[i]);
- }
- //delay(delaytime1);
- }
- void clearMatrix(){
- for (int i = 0; i < 8; i++) {
- lc.setRow(0,i,0);
- }
- //delay(delaytime1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement