I cannot use the arduino library for the QTRX sensors (RC version) so i have to write my own way of reading for the sensors, Can you help me know the steps in order to have a basic reading on the sensors ? Power consumption is not a problem i just need the easiest way to read from the sensors.
I use a 3v3 logic MCU and interface the sensors through a MCP23S17 port expanders and adafruit MCP23S17 library
Following your recommendation in the product page
//Set pins to output
expander1.pinMode(0, OUTPUT);
expander1.pinMode(1, OUTPUT);
expander1.pinMode(2, OUTPUT);
expander1.pinMode(3, OUTPUT);
expander1.pinMode(4, OUTPUT);
expander1.pinMode(5, OUTPUT);
expander1.pinMode(6, OUTPUT);
expander1.pinMode(7, OUTPUT);
expander1.pinMode(8, OUTPUT);
expander1.pinMode(9, OUTPUT);
expander1.pinMode(10, OUTPUT);
expander1.pinMode(11, OUTPUT);
expander1.pinMode(12, OUTPUT);
expander1.pinMode(13, OUTPUT);
expander1.pinMode(14, OUTPUT);
expander1.pinMode(15, OUTPUT);
//set all pins high
expander1.writeGPIOAB(0xFF);
delayMicroseconds(20);
//set back to input
expander1.pinMode(0, INPUT);
expander1.pinMode(1, INPUT);
expander1.pinMode(2, INPUT);
expander1.pinMode(3, INPUT);
expander1.pinMode(4, INPUT);
expander1.pinMode(5, INPUT);
expander1.pinMode(6, INPUT);
expander1.pinMode(7, INPUT);
expander1.pinMode(8, INPUT);
expander1.pinMode(9, INPUT);
expander1.pinMode(10, INPUT);
expander1.pinMode(11, INPUT);
expander1.pinMode(12, INPUT);
expander1.pinMode(13, INPUT);
expander1.pinMode(14, INPUT);
expander1.pinMode(15, INPUT);
//immediatly read the ports
uint16_t data=0;
//unsigned long startTime = micros();
// while (micros() - startTime < readingTimeOutus )
data = expander1.readGPIOAB();
return data; //returns 0b0000000000000000
Assuming I followed the instructions correctly and what is said there is correct. I am unforetunatly not seeing the decay fast enough??
sensors are hovering on white paper and 1/2 of the sensors are on the black space.