Hello
I'm working with an ESP32 board that uses a shift register 74HC165.
In the firmware of this board there is a function that returns the digitalRead of the pins in binary:
static uint64_t in_data(void)
{
uint64_t data = 0;
in_latch_pulse();
for(int i=0;i<48;i++)
{
data = data | ((uint64_t)digitalRead(IN_DATA_PIN))<<i;
clock_pulse();
}
Serial.println(data, BIN);
return data;
}
The output on the serial monitor is like this:
13:02:55.165 -> 111111111101111111111111111111111111111111111111
13:02:55.165 -> 111111111101111111111111111111111111111111111111
13:02:55.165 -> 111111111101111111111111111111111111111111111111
It works fine, however, I needed to extract from this BIN value the value of only one of the pins, for example, extract the value only from position 10 (which in the example above would be just 0).
I needed to save this information in BIN in a String or char* variable to be able to extract the positions I want, but I couldn't do that.
Would anyone have any alternative to help me with this issue?
Thanks in advance.