โพสต์ยอดนิยมจากบล็อกนี้
งาน18
#include <SoftwareSerial.h> #include <DHT11.h> //============================================= #include <Wire.h> #include <LiquidCrystal_I2C.h> //LiquidCrystal_I2C lcd(0x27, 16, 2); LiquidCrystal_I2C lcd(0x3F, 16, 2); SoftwareSerial ArduinoSerial(3, 2); // RX, TX //============================================= int SW_ON = 4,SW_OFF = 5,pin=6;//กำหนดขา INPUT int Sun = 9,CSun = 0,Relay1 = 12, Relay2 = 11; //กำหนดขา OUTPUT int ATL = A0,ATH = A1;//กำหนดขา Analog int VTL1 = 0,VTH1 = 0,TL = 0,TH =0,VRHL = 50,VRHH = 80; DHT11 dht11(pin); //============================================= void setup() { lcd.begin(); Serial.begin(115200); ArduinoSerial.begin(4800); while (!Serial){ ; } //===================================================== lcd.setCursor(0, 0);lcd.print("Elec Pattayatech"); lcd.setCursor(0, 1);lcd.print("Smart Farm 2016 "); delay(5000); ...
งาน8
#include "LedControl.h" #include "Keypad.h" #define C4 262 #define D4 294 #define E4 330 #define F4 349 #define G4 392 #define A4 440 #define B4 494 #define C5 523 char keys[4][4]={ {7,8,9,0}, {4,5,6,0}, {1,2,3,0}, {0,0,0,0}}; byte rowPins[] = {7,6,5,4}; byte colPins[] = {3,2,1,0}; Keypad keypad = Keypad(makeKeymap(keys),rowPins,colPins,4,4); int melody[] = {C4,D4,E4,F4,G4,A4,B4,C5}; int dl = 300; int buzzerpin = 11; LedControl lc=LedControl(8,10,9,1); // Pin 8->DIN, 10->CLK, 9->CS(LOAD), 1 = No.of devices void setup() { lc.shutdown(0,false); lc.setIntensity(0,5); lc.clearDisplay(0); pinMode(buzzerpin,OUTPUT); digitalWrite(buzzerpin,HIGH); } void loop() { char key = keypad.getKey(); if ((key != NO_KEY) && (key < 9)) { lc.setDigit(0,0,key,false); tone(buzzerpin, melody...

ความคิดเห็น
แสดงความคิดเห็น