Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ( 0 != sendstatus && 10 >= fail ) //try until it goes through or you fail to much
- {
- Wire.beginTransmission(Target); // transmit to target
- for ( int data = 0; data < commandlength; data++) //while still have data loop
- {
- Wire.write(command[data]); //send it
- }
- sendstatus = Wire.endTransmission(); // stop transmitting
- if ( 0 != sendstatus )
- {
- Serial.print("GFail:");
- Serial.println(fail);
- fail++; //haha fail
- delay(random(0,1000)); //wait for random
- }
- }
- if ( 0 == sendstatus )
- {
- Serial.println("GIACK"); //YAY you win
- }
- else
- {
- Serial.println("GINACK"); //haha fail
- }
Add Comment
Please, Sign In to add comment