public static byte [ ] digitalReport ( boolean enable ) { byte [ ] result = new byte [ 32 ] ; byte flag = ( byte ) ( enable ? 1 : 0 ) ; for ( byte i = 0 , j = 0 ; i < 16 ; i ++ ) { result [ j ++ ] = ( byte ) ( REPORT_DIGITAL | i ) ; result [ j ++ ] = flag ; } return result ; }
Builds message to enable or disable reporting from Firmata device on change of digital input .