Flappy cow code with sensor tag integrated