could not convert 'digitalWrite(8u, 1u)' from 'void' to 'bool'
This line of code is the source of your problem. 


void loop() {

  if (digitalWrite(8, HIGH));



If expressions expect a boolean (true/false), but if you check the documentation for digitalWrite(), you’ll see it returns “Nothing” (i.e. void). 

You need to use digitalRead() to check the current state of the pin.