Not understanding toggle code

bperrybap:

GoForSmoke:
Is there a binary logic chip made that uses other than 0 for FALSE/LOW and 1 for TRUE/HIGH?
Memory, controller, processor, register?

But we are not talking about chips.
We are talking about how to write software to use a software API function.

Completely wrong. YOU are pissing up the API rope. And I know the difference and I specified it.

The s/w API says use these defines: "HIGH" and "LOW" to get things done.

The s/w API is written to run the chips, not conform to fairyland.

Don't get hung up on this specific digitalWrite() function call and how HIGH and LOW
map to the output states of the pin.

Or TTL, or CMOS, or .....

BTW, there are some chips that use separate set and clear registers.
In that situation, 1 bits written to a clear register will actually clear bits not set them.

if ( var != LOW ) then var = HIGH;
else var = LOW;

I guess THAT will work any better in your dragged up exception huh?
Certainly better than;

var = !var;

Yeah.... whoops! Didn't think of THAT didja?

As for the rest, when I want to get away from the metal I'll choose something other than C to do it. Perhaps Modula or Pascal would be abstract enough, or maybe LISP. For sure COBOL, DBASE, FoxPro, RPG or something along those lines. Something where the programmers are totally insulated from the realities of the hardware.

Make a C/C++ where people HAVE to play by your rules and see how fast it gets adopted as the real thing.