Small error fix and emacs code

master
Torwag 2014-02-11 04:42:01 -08:00
rodzic 09f16351cd
commit 27d3071765
1 zmienionych plików z 14 dodań i 2 usunięć

@ -18,8 +18,20 @@ Pressing `Ctrl-C` will terminate the interactive shell and soft reset the contro
### Further improvements
One can echo those commands into the serial connection of the board to achieve the same goal (make sure you have write permissions).
`echo "\x04\x05" > /dev/ttyASM0`
`echo "\x03\x04" > /dev/ttyACM0`
### Integrate into IDE/Editor
Several IDEs and Editors allow to customize shortkeys to execute arbitrary code.
#### Emacs
Add this somewhere in your emacs init (e.g. ~/.emacs.d/init.el). Adapt the serial device name if necessary. Now press `Ctrl-F5` within Emacs whenever you wish to soft-reset the controller.
(defun restart_micropython ()
" Restart Micropython-Board"
(interactive)
(save-buffer) ;; make sure to write changes to disk
(shell-command "echo \"\\x03\\x04\" > /dev/ttyACM0")
)
;; Set a global key to initiate soft reset (customize as desired)
(global-set-key (kbd "C-<f5>") 'restart_micropython)