งาน ปฎิบัติ 5 รับลิงก์ Facebook X Pinterest อีเมล แอปอื่นๆ สิงหาคม 20, 2561 จอ LCD wiring diagram Code 1 #include <LiquidCrystal.h> LiquidCrystal lcd(12, 10, 4, 5, 6, 7); งาน ปฎิบัติ 5 จอ LCD void setup() { lcd.begin(16, 2); lcd.print("PLAUM"); lcd.setCursor(0, 1); lcd.print("ITTIWAT"); } void loop() { } รับลิงก์ Facebook X Pinterest อีเมล แอปอื่นๆ ความคิดเห็น
งานปฏิบัติ 18 ตุลาคม 18, 2561 งานปฏิบัติ 18 Smart Farm system Code 1 #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 Fa... อ่านเพิ่มเติม
งานปฏิบัติ 11 ตุลาคม 18, 2561 งานปฏิบัติ 11 Code #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); int aVal=0,tempaVal=0; void setup() { lcd.begin(); } void loop() { aVal = analogRead(A0); if (tempaVal != aVal) { lcd.clear(); lcd.setCursor(0,0); lcd.print("LDR"); lcd.setCursor(0,1); lcd.print(aVal); delay(300); } tempaVal = aVal; } อ่านเพิ่มเติม
งานปฏิบัติ 16 ตุลาคม 18, 2561 งานปฏิบัติ 16 การควบคุมมอเตอร์ Code 1 #include <Stepper.h> #include "Keypad.h" #define STEP_ANGLE_4STEP 32 //360/11.25 degree #define STEP_OUT_WITH_GEAR 2048 //32*64 Stepper stepper(STEP_ANGLE_4STEP,8,10,9,11); char keys[4][4]={ {'7','8','9','A'}, {'4','5','6','B'}, {'1','2','3','C'}, {'*','0','#','D'}}; byte rowPins[] = {7,6,5,4}; byte colPins[] = {3,2,1,0}; int speedmotor = 400; int dirmotor = 1; Keypad keypad = Keypad(makeKeymap(keys),rowPins,colPins,4,4); void setup() { } void loop() { char key = keypad.getKey(); if (key != NO_KEY) { if (key == '1') speedmotor = 400; if (key == '2') speedmotor = 700; if (key == '3') speedmotor = 1000; if (key == 'A') ... อ่านเพิ่มเติม