Help with the syntax for a 74HC595 shift register

Apologies if this is obvious but as a newbie I am struggling.

I am making a project to read a series of temperatures and display whether they are above or below target by the on/off state of a series of LED’s. To reduce the number of output I plan to use a 74HC595.

The simple test is as follows

digitalWrite(latchPin,LOW);
tempState1 =(sensors.getTempC(Probe01));

// series of decisions on which LEDs to light
if (tempState1>=23.00)
{
Serial.print(" “);
Serial.print(tempState1);
Serial.print(” LOW");
bitSet(Low,0);
}
else if (tempState1<23.00)
{
Serial.print(" “);
Serial.print(tempState1);
Serial.print(” HIGH");
bitSet(HIGH, 0);

//Repeat for eight sensor incrementing from 0 to 7

//The ShftOut11 example then hasthe following
digitalWrite(latchPin, LOW);
// shift out the bits:
shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay);

//take the latch pin high so the LEDs will light up:
digitalWrite(latchPin, HIGH);
QUESTIONS.
Should I use ‘bitSet’ rather than ‘bitWrite’ and what does ‘numberToDisplay’ represent.

Any help gratefully received.

Sedbergh

what does 'numberToDisplay' represent.

We don't know, because you didn't post your code (or use code tags)

OK. Sorry but I do not even know what code tags are! All very challenging at my age.

Having looked at the Arduino Reference file I see that the syntax should be

shiftOut(dataPin,clockPin,MSBFIRST, value)

In the ShftOut11 tutorial value is defined as the variable 'numberToDisplay'.

I missed that, but I am still confused as to what 'value' represents when I have transferred each of the eight bits individually using bitSet.

Please bear with me.

I missed that, but I am still confused as to what 'value' represents when I have transferred each of the eight bits individually using bitSet.

bitSet only sets the bit in a variable - it doesn't transfer the variable to the serial data pin.

      bitSet(Low,0);
...
... bitSet(HIGH, 0);

I think you need to look again at what bitSet is.

“OK. Sorry but I do not even know what code tags are! All very challenging at my age.”

If you would read the instructions in the “How To Use This Forum” post at the top of the board it wouldn’t be a mystery. At any age, reading the directions before you act is a good idea.