ข้ามไปที่เนื้อหาหลัก

บทความ

กำลังแสดงโพสต์จาก เมษายน, 2018

Mini Project

Alcohol Detector อุปกรณ์ - MQ-3 alcohol sensor - Arduino uno - 10pcs 5V active buzzer - Microtivity IM206 6x6x6mm tact switch - 12C LCD screen - 10 kOhm resistor - Breadboard - 10 X male/male jumper wires - 10 X male/female jumper wires Diagram Code #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,20,4); const int buttonPin = 2; const int buzzerPin = 7; const int AOUTpin=0;//the AOUT pin of the alcohol sensor goes into analog pin A0 of the arduino const int DOUTpin=8;//the DOUT pin of the alcohol sensor goes into digital pin D8 of the arduino const int ledPin=13;//the anode of the LED connects to digital pin D13 of the arduino int ledpin1 = 3; int ledpin2 = 4; int ledpin3 = 5; int limit; int value; int buttonState = 0;  void setup() { Serial.begin(9600);  lcd.init();   lcd.backlight(); pinMode(buttonPin, INPUT);  pinMode(buzzerPin,OUTPUT); pinMode(DOUTpin, INPUT);//sets the