Last active
March 24, 2020 23:04
-
-
Save Sidchou/a82cd834acb278acca65df990583f450 to your computer and use it in GitHub Desktop.
Adafruit MiCS5524 CO, Alcohol and VOC Gas Sensor Breakout test code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
simple test code for Adafruit MiCS5524 CO, Alcohol and VOC Gas Sensor Breakout board | |
https://www.adafruit.com/product/3199 | |
*/ | |
const int enPin = 4; | |
const int analogPin = A1; | |
//declare pin using | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(enPin, OUTPUT); | |
pinMode(analogPin, INPUT); | |
//declare pin mode | |
digitalWrite(enPin,LOW); | |
//set enable to low to activate the sensor and heater for it | |
Serial.begin(9600); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
int analogReading = analogRead(analogPin); | |
Serial.println(analogReading); | |
//print reading in serial | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment