commands:extra
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| commands:extra [2021/09/23 17:16] – external edit 127.0.0.1 | commands:extra [2026/05/31 04:37] (current) – change the version requirement text for shortcut brandon | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Command: | + | ====== Command: |
| - | --> | + | -->MS2000 and RM2000 |
| - | ^Format | + | ^Shortcut | EX <wrap lo>// |
| - | ^Type |Card-Addressed| | + | ^Format |
| - | ^Remembered |Using | + | ^Remembered |Using SS Z | |
| <-- | <-- | ||
| - | -->MS2000 and RM2000 | + | --> |
| - | ^Format | + | ^Shortcut | EX <wrap lo>// |
| - | ^Remembered |Using SS Z | | + | ^Format |
| + | ^Type |Card-Addressed| | ||
| + | ^Remembered |Using | ||
| <-- | <-- | ||
| + | |||
| **X? | **X? | ||
| **Y? | **Y? | ||
| - | The **Z** argument sets the integral error servo parameter. | + | The **Z** argument sets the integral error servo parameter. The default is '' |
| + | This is also the '' | ||
| - | **M?** Returns | + | <WRAP center round info 80%> |
| + | When CRISP restores KI Z after using lock_ki, it uses a saved value that is set only once when the controller powers on. If you want to change KI Z, use [[commands: | ||
| + | </ | ||
| - | **M=#** Modify the '' | + | <wrap lo> |
| + | **T?:** The controller detects the resolution of the ADC during initialization. | ||
| + | |||
| + | ^Code^DAC^CPU^ | ||
| + | | 0 | 10-bit ADC | '' | ||
| + | | 1 | 12-bit ADC | '' | ||
| + | |||
| + | <wrap lo> | ||
| + | **M?** Returns the '' | ||
| + | |||
| + | **M=#** Modify the '' | ||
| This command differs from [[commands: | This command differs from [[commands: | ||
| - | --> | + | --> |
| The '' | The '' | ||
| Line 47: | Line 63: | ||
| Each '' | Each '' | ||
| - | ^Code ^Type ^ | + | ^Decimal |
| - | |0 |Not Pressed| | + | |0 | '' |
| - | |1 |Normal Press| | + | |1 | '' |
| - | |2 |Long Press| | + | |2 | '' |
| - | |3 |Extra Long Press| | + | |3 | '' |
| Example: | Example: | ||
| Line 67: | Line 83: | ||
| - '' | - '' | ||
| - '' | - '' | ||
| + | |||
| + | <-- | ||
| \\ | \\ | ||
| - | --> Example Python code for extracting button states from the button_flag_byte# | ||
| - | <code python> | ||
| - | # the value returned from EXTRA M? | ||
| - | button_flag_byte = 127 | ||
| - | # bit masks | + | Example Python code for extracting button states from the button_flag_byte: |
| - | mask_at | + | |
| - | mask_home = 0x0C # 00001100 | + | |
| - | mask_js | + | |
| - | mask_zero = 0xC0 # 11000000 | + | |
| - | # get the button states from button_flag_byte | + | {{section>: |
| - | btn_at | + | |
| - | btn_home = (button_flag_byte | + | |
| - | btn_js | + | |
| - | btn_zero = (button_flag_byte & mask_zero) >> 6 | + | |
| - | + | ||
| - | # show the results in decimal and binary | + | |
| - | print(f" | + | |
| - | print(f" | + | |
| - | print(f" | + | |
| - | print(f" | + | |
| - | print(f" | + | |
| - | + | ||
| - | # console output: | + | |
| - | # button_flag_byte = 127 (binary 01111111) | + | |
| - | # btn_at = 3 (binary 11) | + | |
| - | # btn_home = 3 (binary 11) | + | |
| - | # btn_js = 3 (binary 11) | + | |
| - | # btn_zero = 1 (binary 01) | + | |
| - | </ | + | |
| - | <-- | + | |
| - | + | ||
| - | <-- | + | |
| - | --> | + | --> |
| This function allows you to simulate button presses programmatically through a serial command. | This function allows you to simulate button presses programmatically through a serial command. | ||
| Line 124: | Line 112: | ||
| \\ | \\ | ||
| This demonstrates that button presses are overwritten as if you were interacting with the physical controller pressing buttons. | This demonstrates that button presses are overwritten as if you were interacting with the physical controller pressing buttons. | ||
| - | \\ | ||
| - | --> Example Python code for creating a button_code# | ||
| - | <code python> | ||
| - | def create_button_code(at: | ||
| - | assert at in range(4), "Must be in the range 0-3." | ||
| - | assert home in range(4), "Must be in the range 0-3." | ||
| - | assert joystick in range(4), "Must be in the range 0-3." | ||
| - | assert zero_halt == 0 or zero_halt == 1, "Must be 0 or 1." | ||
| - | button_code = 0 | + | <-- |
| - | # bit masks | + | Example Python code for creating a button_flag_byte: |
| - | BITMASK_AT | + | |
| - | BITMASK_HOME = 0x0C # 00001100 | + | |
| - | BITMASK_JS | + | |
| - | BITMASK_ZERO = 0xC0 # 11000000 | + | |
| - | | + | {{section>: |
| - | button_code | + | |
| - | button_code |= at & BITMASK_AT | + | |
| - | + | ||
| - | button_code &= ~BITMASK_HOME | + | |
| - | button_code |= (home << 2) & BITMASK_HOME | + | |
| - | + | ||
| - | button_code &= ~BITMASK_JS | + | |
| - | button_code |= (joystick << 4) & BITMASK_JS | + | |
| - | + | ||
| - | button_code &= ~BITMASK_ZERO | + | |
| - | button_code |= (zero_halt << 6) & BITMASK_ZERO | + | |
| - | + | ||
| - | return button_code | + | |
| - | + | ||
| - | def main(): | + | |
| - | button_code = create_button_code(at=1, | + | |
| - | print(button_code) | + | |
| - | # prints 5 | + | |
| - | + | ||
| - | if __name__ == " | + | |
| - | main() | + | |
| - | + | ||
| - | </ | + | |
| - | <-- | + | |
| - | + | ||
| - | <-- | + | |
| {{tag> | {{tag> | ||
Address: 29391 W Enid Rd. Eugene, OR 97402, USA | Phone: +1 (541) 461-8181
commands/extra.1632431778.txt.gz · Last modified: by 127.0.0.1
