跳到主要內容

發表文章

DIY Electronic Alarm

This is my DIY Electronic Alarm, now the prototype has been finished with breadboard, but the PCB layout has not been finished yet. I use a MCU(Arduino Uno) and four 74LS47 7-segment-display drivers to control the four 7-segment-displays to show the digits of Minutes and Seconds. When the alarm is triggered, the buzzer will generate sound.
最近的文章

LED Tetris

Here is the implementations of code for LED Tetris game. #include "config.h" #include <stdio.h> void write_data(unsigned char,unsigned char); //Writing data to the MAX7219 chip to display different 8x8 LED patterns unsigned int led_element[8][8];  //Global variables 2D array for static tetris blocks unsigned int decimal_value=0; unsigned int row_cancel=0; //stores the current number of rows cancelled unsigned int button_pressed=0;  unsigned int step_fallen=0 ; //unsigned int random_total; unsigned int block_type; unsigned char x_button=3 ; //Global variables x for the coordinates of the temp falling block                     //Declaring x corrdinate of temp falling block allows you to modify its coordinate everywhere, in any scope unsigned int rotation_index = 0; unsigned int rotation_button_pressed = 2; unsigned int score=0; unsigned int n; unsigned int first_digit; unsigned int second_digit; void bingo(); //If 8 LEDs i

Heart-shaped LED Chaser PCB Board

Using Printed Circuit Board (PCB) can give you a neat and stable electronic circuit assembly. A month ago I used PCB technology to make a heart-shaped LED Chaser board.

Moving custom-made pixel patterns in LCD

Do you want to know how to move custom-made pixel patterns in LCD ? Here it is : #include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int movL,movR; int i=0; byte pixels[8] = {  B11111,   B10001,   B11011,   B10001,   B11111,   B01010,   B01010,   B01010 }; void setup() {   pinMode(14,INPUT_PULLUP);   pinMode(15,INPUT_PULLUP);   lcd.createChar(0, pixels);   lcd.begin(16, 2);   lcd.write(byte(0)); } void loop() {     movL=digitalRead(14);     movR=digitalRead(15);     if(movL==0)     {      i++;     lcd.clear();     lcd.setCursor(i,0);     lcd.write(byte(0));     delay(200);     }     if(movR==0)     {      i--;     lcd.clear();     lcd.setCursor(i,0);     lcd.write(byte(0));     delay(200);     }   }

Build an Electronic Calculator with Arduino

Do you want to know how to make an Electronic Calculator with Arduino mega ? Here it is. // Electronic Calculator //Written by Matt Kan //Instagram : matt_kan1122 //Email : kmat111222333@gmail.com //Reuse or redistribution is allowed, so long as credit has been given to the original maker #include <LiquidCrystal.h> const int RS = 12, EN = 11, D4 = 5, D5 = 4, D6 = 3, D7 = 2; LiquidCrystal lcd(RS, EN, D4, D5, D6, D7); int readButtonState[16]; //to initialize all the 16 input buttons from digits 0 to 9 to + - x / = CLR long output[2]; // the total result = 1st output + 2nd output , for example, result = 111+41 = 152 int digit[7];     // to store the input digits int addFlag=0; int subFlag=0; int multiFlag=0; int divFlag=0; //These flags are for the recongition of which button(+ - x /) the user has entered void setup() {   Serial.begin(9600);  // You need to enter this code for applying the Serial Monitor,very convenient   for(int k=14;k<=30;k++)