eeprom read a specific bit

Hello
I’m triyng to use a eeprom for a project and I’m starting the the exemple to understand his behavior.
I upload this sketch to my mega:

#include <EEPROM.h>

int a = 0;
int value;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  value = EEPROM.read(a);

  Serial.print(a);
  Serial.print("\t");
  Serial.print(value);
  Serial.println();

  a = a + 1;

  if (a == 512)
    a = 0;

  delay(500);
}

The read value is a byte, but what if I just want to look to a specific bit on that byte?
Is this possible?
I want to use just a byte to store at least 8 sensor status(on, off) on the 8 bits of the byte. Litle confuse :sweat_smile:
any tip?

The read value is a byte, but what if I just want to look to a specific bit on that byte? Is this possible?

The smallest unit you can write to/read from EEPROM is a byte. The bitRead(), bitSet(), bitClear(), and bitWrite() functions allow you read/write individual bits within that byte.

I want to use just a byte to store at least 8 sensor status(on, off) on the 8 bits of the byte.

You'll need a bithorn (kind of like shoehorn) to get more than 8 bits in a byte.

bitRead(), bitSet(), bitClear(), and bitWrite()

I didn't know those functions. Thats really what I need. Thanks for the tip. XD