Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int mq2Pin = A1;
- int dig = 13;
- void setup() {
- // put your setup code here, to run once:
- pinMode(mq2Pin, INPUT);
- pinMode(13, INPUT);
- Serial.begin(9600);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- int analVal = analogRead(mq2Pin);
- int digiVal = digitalRead(dig);
- Serial.print("Analog Value = ");
- Serial.print(analVal);
- Serial.print(" Digital Value = ");
- Serial.println(digiVal);
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement