Questions Question 1. Given the following command to setup a song on the iRobot
ID: 3592899 • Letter: Q
Question
Questions Question 1. Given the following command to setup a song on the iRobot Create 2 (page 19 of the Open Interface Spec) sral setuernce (1401Sng Numberong Length) INote Number ij [Note Duration i (Note Number 2] [Note Duration 2], etc. where Song Number (0-4): The song number associated with the specific song. If you send a second Song command, using the same song number, the old song is overwritter. Song Length (1-16): The length of the song, according to the number of musical notes within the song. Song data bytes 3, 5, 7, etc.: Note Number (31-127): The pitch of the musical note Roomba will play, according to the MIDI note numbering scheme. The lowest musical note that Roomba will play is Note #31. Roomba considers all musical notes outside the range of 31-127 as rest notes, and will make no sound during the duration of those notes. Song data bytes 4, 6, 8, etc.: Note Duration (0-255): The duration of a musical note, in increments . . of 1/6hp of a second. Example: a half-second long musical note has a duration value of 32 ts the command [1401 [0] (4] 31] (32] (127) (64] [31] (a6j) correct? If not, how to fix it?Explanation / Answer
Here, in this example
Serial sequence is,[140] [Song Number] [Song Length] [Note Number1] [Note Duration1] [Note Number2] [Note Duration2],[ Note Number3] [Note Duration3],etc.
-Song Number should be between 0 & 4.
-Song Length should be from 1 to 16 depending on the number of musical notes in the song.
-For the note numbers 31-127, the pitch of the musical note Roomba will play. The notes outside the range 31-127, will make no sound. So the value of Note Number should be between 31 &127.
-Note Duration, is as mentioned, in increments of 1/64th of a second.
-Now in this command,
[140] [0] [4] [31] [32] [127] [64] [31] [16]
0 indicates song number and is correct.4 indicates total number of musical notes. For note number 31 duration value is 32, for note number 127 duration value is 64, and similarly for the next note number 31 duration value is 16.
-Here Number of notes are written as 4, and only three of them are specified. So the given command is ‘Not correct’. We can make it correct by specifying one more note number, and the duration value for that note.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.