Questions Question 1. Given the following command to setup a song on the iRobot
ID: 3594238 • 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) Serial sequence: [140] [Song Number] [Song Length] [Note Number 1] [Note Duration 1] [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 overwritten. 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/64n of a second. Example: a half-second long musical note has a duration value of 32. Is the command [140] [0] [4131132] [127] [ [31] [16] correct? if not, how to fix it?Explanation / Answer
Hi,
Given the format of command is
[140][song number][song length][note number 1][note duration 1][note number 2][note duration 2]etc
Given command is
[140][0][4][31][32][127][64][31][16]
here 0 is the song number which is in valid range given 0-4
song length is 4 which is also in valid range given 0-16
next come the notes, there are 3
note number note duration
31 32(half second)
127 64(one second)
31 16(1/4 second)
first note 31 is played for half second, then note 127 for one second and then note 31 for 0.25 second
Thumbs up if this was helpful, otherwise let me know in comments
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.