Skip to content

Instantly share code, notes, and snippets.

@benve
Created March 11, 2011 16:08
Show Gist options
  • Save benve/866091 to your computer and use it in GitHub Desktop.
Save benve/866091 to your computer and use it in GitHub Desktop.
Esempi di accensione e spegnimento di bit in Processing
//byte c = byte(unbinary("00000000"));
byte c = byte(3);
println(binary(c));
int pointer = 1;
//Spegne
//c &= ~(1 << pointer);
//Accende
//c |= (1 << pointer);
c ^= (1 << pointer);
println((c &(1 << pointer)) != 0);
println(binary(c));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment