Devices & Components
Arduino Nano
Male/Female Jumper Wires
Grove - Gas Sensor(MQ2)
Solderless Breadboard Half Size
Hardware & Tools
Multitool, Screwdriver
Software & Tools
Arduino IDE
Project description
Code
Sample code
arduino
You can use this code to obtain the analogue readings from the MQ type sensor module
1int sensor = A0; 2int reading; 3void setup(){ 4 Serial.begin(9600); 5} 6void loop(){ 7 reading = analogRead(sensor); 8 Serial.println("Reading: "); 9 Serial.print(reading); 10}
Comments
Only logged in users can leave comments