Processing & Arduino
by Shelandy Ting
powered by Emacs + reveal.js + github
it is an easy and quick way for beginners to use Processing for learning drawing things,
and to use Arduino for making interaction in physical things
the learning experience of Processing(Java-based) or Arduino (C-based) can be reused in the journey of leaning Java/C and something else later
Is built-in Processing/Arduino IDE powerful enough?
Emacs is portable, light-weighted (e.g., fast), yet powerful
Emacs is a good platform (instead of just being an editor), so the learning experience can be applied to other tasks
e.g., using Emacs with reveal.js libraries to write HTML5 presentation slides like this one, where I do not need to learn JavaScript yet I can easily come up an nice interactive sides for presentation.
download the Emacs
install the required packages:(ECB, JDEE, multi-refactory...)
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
)
"control" key with other key. E.g., C-d means Control-d: press "d"-key while holding Control key
let it finish the download and compilation
then quit (Main Menu -> File -> Quit) the Emacs and relaunch
(defun my-xref-settings ()
(defvar c-xref-current-project nil) ;; can be also "my_project_name"
(defvar c-xref-key-binding 'global) ;; can be also 'local or 'none
(setq load-path (cons "/usr/local/c-xref/emacs" load-path))
(setq exec-path (cons "/usr/local/c-xref" exec-path))
(load "c-xrefactory")
(provide 'xref-settings))
(add-hook 'processing-mode-hook 'processing-mode-init)
(autoload 'processing-mode "processing-mode" "Processing mode" t)
(add-to-list 'auto-mode-alist '("\\.pde\\'" . processing-mode))
(defun processing-mode-init ()
(setq processing-sketchbook-dir "~/yourProcessingDir")
(setq processing-output-dir "/tmp")
(my-xref-settings))
;;;;;;
((eq system-type 'gnu/linux) ;; os specific setting
(progn
(setq processing-location "/usr/local/processing-3.2.1/processing-java")
(setq processing-application-dir "/usr/local/processing-3.2.1/")
))
(custom-set-variables
'(jdee-compiler (quote ("javac")))
'(jdee-jdk-registry (quote (("1.8" . "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-1.b14.1.mga5.x86_64") ("" . "")))))
(defun my-java-mode-extra ()
(my-jde-refactor-init)
(my-xref-settings) ; have to use add-hook instead of eval-after-load
)
(add-hook 'java-mode-hook 'my-java-mode-extra)
(eval-after-load "java-mode" 'my-java-mode-extra) ; only load snippets files after using yasnippet
use the icon on menu to save the changed file, or type C-x C-s
yes!
Emacs is a flexible platform, not just a simple editor
Static relationship (e.g., scope in declaration hierarchy)
(fully by JDEE mode package, partially by processing mode package)
mapping dynamic relationship e.g., all locations using this method/variable
(by highlight-symbol package)
need a authoring tool to make up here as the end: