Answers.Body: <p>The Mario element has six switches on the front:</p>
  <p><a href="https://i.sstatic.net/UC4gO.png" rel="noreferrer"><img src="https://i.sstatic.net/UC4gO.png" alt="Mario Element" /></a></p>
  <p>The inside of the pants in the power-up sets include six plastic ridges that can be either high or low. They interact with the switches on Mario's torso in much the same way as the cuts on a key interact with a particular lock. The torso reads the pattern on the buttons to determine the power-up state. Here's an example showing the six ridges on the regular pants from the starter set and the ridges on Cat Mario:</p>
  <p><a href="https://i.sstatic.net/nI5Ch.jpg" rel="noreferrer"><img src="https://i.sstatic.net/nI5Ch.jpg" alt="Pants photo" /></a></p>
  <p>The switches expect the following states for each of the pants elements (bits are read from left to right when looking at Mario):</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Bit Pattern</th>
  <th>Power-up</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>000000</td>
  <td>None</td>
  </tr>
  <tr>
  <td>001100</td>
  <td>Propeller</td>
  </tr>
  <tr>
  <td>010001</td>
  <td>Cat</td>
  </tr>
  <tr>
  <td>010010</td>
  <td>Fire</td>
  </tr>
  <tr>
  <td>100001</td>
  <td>Normal</td>
  </tr>
  <tr>
  <td>100010</td>
  <td>Builder</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Power-ups can be emulated by holding in the correct buttons. The play experience won't be great, but this could be used to see what a power-up does if you don't own it.</p>
  <p>There's more detail on exactly what is read and presented via the Bluetooth interface on <a href="https://github.com/bricklife/LEGO-Mario-Reveng/blob/master/IOType-0x4a.md" rel="noreferrer">Shinichiro Oba's Github</a>.</p>
  <p>It's worth noting that the included hats are for decoration only. They have no impact on behavior, and there is no mechanism for them to be detected or identified.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T15:27:52.697Z
Answers.Text: And here I was thinking "oh, they're probably using NFC, that's pretty cool…" Nope. Low tech FTW. :)
Answers.UserDisplayName: Ilmari Karonen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T15:29:45.803Z
Answers.Text: BTW, there's something odd about the table on GitHub that you link to: it appears to be giving the bit patterns for the various power-ups in both hexadecimal and binary, but the given values for Propeller Mario (`06` and `001100`) don't match. Either the bit pattern for Propeller Mario should actually be `000110` or the hex value should be `0C`. Either one looks like a somewhat plausible typo, so I've no idea which one's right.
Answers.UserDisplayName: Ilmari Karonen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T16:23:35.643Z
Answers.Text: Odd that they're using twice as many bits as necessary.  Maybe they're planning on expanding the set, but is there any chance they'll ever get anywhere close to 64 different powers?  (Or even just 33, which is the first number that would require that 6th bit.)
Answers.UserDisplayName: Darrel Hoffman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T18:30:22.547Z
Answers.Text: @DarrelHoffman I would assume symmetry.
Answers.UserDisplayName: Aaron D. Marasco
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T18:31:13.900Z
Answers.Text: My kids had a train with blocks that had similar (each block gave a different pattern). Then they started holding down with their fingers different combos until they found non-Roman letters and then even a combo that locked it up.
Answers.UserDisplayName: Aaron D. Marasco
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T18:35:44.090Z
Answers.Text: @DarrelHoffman: I suspect they're trying for an N-out-of-M encoding (2 out of 6, in this case). That way, your Builder Mario won't suddenly turn into Cat Mario just because his pants are a little loose and one of the switches doesn't get pushed all the way in. (Admittedly, they could've still used e.g. a 4 bit parity code to achieve the same result, but 6 bits still indeed leaves more room for expansion, and maybe they just got a good deal on six-switch arrays or something.)
Answers.UserDisplayName: Ilmari Karonen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T23:38:37.740Z
Answers.Text: @IlmariKaronen I've confirmed that the bit value for the propeller pants is 001100 and opened a PR to change the hex value to 0C.
Answers.UserDisplayName: jncraton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-13T11:54:21.313Z
Answers.Text: @IlmariKaronen - Whenever you can get away with low tech - do it. It's simpler, easier to build, cheaper, more robust and durable. Well, most of the time anyway. And it's always _so_ satisfying to see something complicated and impressive being achieved by something absolutely elementary.  :)
Answers.UserDisplayName: Vilx-
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-27T14:48:12.003Z
Answers.Text: How would you trigger the proper switches anyway?
Answers.UserDisplayName: user17394
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-27T18:01:01.620Z
Answers.Text: @user17394 I was able to depress the switches using my fingernails. Anything small should work.
Answers.UserDisplayName: jncraton
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T00:37:22.147Z
Answers.LastActivityDate: 2020-12-27T17:46:48.827Z
Answers.LastEditDate: 2020-12-27T17:46:48.827Z
Answers.UserDisplayName: jncraton
Body: <p>The LEGO Super Mario theme includes an intelligent brick that interacts with various other elements present in the sets:</p>
  <p><a href="https://i.sstatic.net/pZnOt.png" rel="noreferrer"><img src="https://i.sstatic.net/pZnOt.png" alt="enter image description here" /></a></p>
  <p>There are several <a href="https://brickset.com/sets/theme-Super-Mario/subtheme-Power-Up-Pack" rel="noreferrer">Power-up sets</a> available that provide Mario with additional powers and alter his behavior in various ways. How does the brick interact with these power up packs to know when they are in use?</p>
  <p>Here's an example power-up pack:</p>
  <p><a href="https://i.sstatic.net/e17ZS.jpg" rel="noreferrer"><img src="https://i.sstatic.net/e17ZS.jpg" alt="Cat Mario" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-28T21:07:53.733Z
Comments.Text: Try doing 001001
  It has weird effects...
Comments.UserDisplayName: Cloudy Star Sky 666
Tags: <piece-information><activity-support><super-mario>
Title: How does the LEGO Super Mario figure know which power up is attached?
UserDisplayName: jncraton
ThreadText: # How does the LEGO Super Mario figure know which power up is attached?
  
  (Asked by: username_0 on 2020-09-11)
  
  The LEGO Super Mario theme includes an intelligent brick that interacts with various other elements present in the sets:
  
  [![enter image description here](https://i.sstatic.net/pZnOt.png)](https://i.sstatic.net/pZnOt.png)
  
  There are several [Power-up sets](https://brickset.com/sets/theme-Super-Mario/subtheme-Power-Up-Pack) available that provide Mario with additional powers and alter his behavior in various ways. How does the brick interact with these power up packs to know when they are in use?
  
  Here's an example power-up pack:
  
  [![Cat Mario](https://i.sstatic.net/e17ZS.jpg)](https://i.sstatic.net/e17ZS.jpg)
  
  **Tags:** piece-information, activity-support, super-mario
  > **Comments:**
  > **username_1**: Try doing 001001 It has weird effects...  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-09-11. Score: 38 | Accepted answer
  
  The Mario element has six switches on the front:
  
  [![Mario Element](https://i.sstatic.net/UC4gO.png)](https://i.sstatic.net/UC4gO.png)
  
  The inside of the pants in the power-up sets include six plastic ridges that can be either high or low. They interact with the switches on Mario's torso in much the same way as the cuts on a key interact with a particular lock. The torso reads the pattern on the buttons to determine the power-up state. Here's an example showing the six ridges on the regular pants from the starter set and the ridges on Cat Mario:
  
  [![Pants photo](https://i.sstatic.net/nI5Ch.jpg)](https://i.sstatic.net/nI5Ch.jpg)
  
  The switches expect the following states for each of the pants elements (bits are read from left to right when looking at Mario):
  
  | Bit Pattern | Power-up |
  | --- | --- |
  | 000000 | None |
  | 001100 | Propeller |
  | 010001 | Cat |
  | 010010 | Fire |
  | 100001 | Normal |
  | 100010 | Builder |
  
  Power-ups can be emulated by holding in the correct buttons. The play experience won't be great, but this could be used to see what a power-up does if you don't own it.
  
  There's more detail on exactly what is read and presented via the Bluetooth interface on [Shinichiro Oba's Github](https://github.com/bricklife/LEGO-Mario-Reveng/blob/master/IOType-0x4a.md).
  
  It's worth noting that the included hats are for decoration only. They have no impact on behavior, and there is no mechanism for them to be detected or identified.
  
  > **Comments:**
  > **username_2**: And here I was thinking "oh, they're probably using NFC, that's pretty cool…" Nope. Low tech FTW. :)  
  > **username_2**: BTW, there's something odd about the table on GitHub that you link to: it appears to be giving the bit patterns for the various power-ups in both hexadecimal and binary, but the given values for Propeller Mario (`06` and `001100`) don't match. Either the bit pattern for Propeller Mario should actually be `000110` or the hex value should be `0C`. Either one looks like a somewhat plausible typo, so I've no idea which one's right.  
  > **username_3**: Odd that they're using twice as many bits as necessary.  Maybe they're planning on expanding the set, but is there any chance they'll ever get anywhere close to 64 different powers?  (Or even just 33, which is the first number that would require that 6th bit.)  
  > **username_4**: @DarrelHoffman I would assume symmetry.  
  > **username_4**: My kids had a train with blocks that had similar (each block gave a different pattern). Then they started holding down with their fingers different combos until they found non-Roman letters and then even a combo that locked it up.  
  > **username_2**: @DarrelHoffman: I suspect they're trying for an N-out-of-M encoding (2 out of 6, in this case). That way, your Builder Mario won't suddenly turn into Cat Mario just because his pants are a little loose and one of the switches doesn't get pushed all the way in. (Admittedly, they could've still used e.g. a 4 bit parity code to achieve the same result, but 6 bits still indeed leaves more room for expansion, and maybe they just got a good deal on six-switch arrays or something.)  
  > **username_0**: @IlmariKaronen I've confirmed that the bit value for the propeller pants is 001100 and opened a PR to change the hex value to 0C.  
  > **username_5**: @IlmariKaronen - Whenever you can get away with low tech - do it. It's simpler, easier to build, cheaper, more robust and durable. Well, most of the time anyway. And it's always _so_ satisfying to see something complicated and impressive being achieved by something absolutely elementary.  :)  
  > **username_6**: How would you trigger the proper switches anyway?  
  > **username_0**: @user17394 I was able to depress the switches using my fingernails. Anything small should work.  
  
  ---
  
  