The Arduino C code that detects goals