跳到主要內容

發表文章

目前顯示的是有「calculator」標籤的文章

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   ...