Bubble counter problems using a teensy for brewing need a little help please.

It seems that you don't understand the difference between setup() and loop().

When the Arduino program starts it runs setup() once. That means the your command "valold = digitalRead(photoPin);" will happen once.

When setup() is finished loop() runs repeatedly. So

 if (val != valold) {
      count ++;
      valold = val;
    }

will run over and over for ever. What do you think will happen the variable called count (which, by the way does not seem to have beed declared anwhere). And what do you think will happen with the test "if (val != valold)".

The net effect of all this (I think) is that the presence of a bubble is only checked once and ........ ?

Separately, your use of the the phrase "using note pad as the external editor so that I can have some type of log" makes me think you have the wrong concept of what an editor does. An editor is the thing you use to write your code. It's job is complete wne you compile (verify and upload) your code. It has nothing to do with the output from the Arduino. The output can be viewed in the Arduino Serial Monitor or any other terminal such as puTTY. Most of those other terminals have the option of saving what they receive into a text file.

...R