Skip to content

Instantly share code, notes, and snippets.

@Sidchou
Last active March 24, 2020 23:04
Show Gist options
  • Save Sidchou/a82cd834acb278acca65df990583f450 to your computer and use it in GitHub Desktop.
Save Sidchou/a82cd834acb278acca65df990583f450 to your computer and use it in GitHub Desktop.
Adafruit MiCS5524 CO, Alcohol and VOC Gas Sensor Breakout test code
/*
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