I'm currently trying to make a robot car that detects gas and moves towards its source.
I have programmed a bunch of macros for movement (they just turn motors on and off, so for turning right it would turn the right motors on and left motors off) and installed an MQ2 sensor that takes the gas readings.
I have managed to make the car start and stop when it detects certain thresholds of the gas/smoke however, as I have mentioned before, I would like the car to save old readings and keep comparing them with new readings so, if it starts driving towards a direction where the gas density is smaller, it should turn some other way to head towards spaces with higher density. Ultimately I want it to be able to find the spot with the highest density and stop/start making noise.
I'm not really sure how feasible it really is; I have some ideas on how I could possible accomplish this (EEPROM?) but I have no concrete plan on how to do it.
I'm sorry if it doesn't make much sense - I'm still a bit clueless when it comes to Arduino .