Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: add-trigger-fn , Previous: add-sfz-preset , Up: A , Home: Overview

Clamps Dictionary

add-ssensor

Function

(add-ssensor id port)

Add a serial sensor with id to port and register it.

Arguments

id Integer in the range [0..127] denoting the id of the sensor.lisp
port Keyword or Symbol denoting the id of a registered port.

Example

;; after connecting a serial sensor physically to /dev/ttyACMC0
(open-ssensor-port :ssensor-1 "/dev/ttyACM0")

;; add the sensor sending an id of 1 to the device connected to the
;; port above to the serial-sensor infrastructure
(add-ssensor 1 :ssensor-1)

;; move the sensor and read values:

;; mean value of accelerometer
(acc 1)

;; value of gyrometer y
(gyro-y)

;; attaching actions to received data:

(defparameter *unwatch* nil)

(progn
  (unwatch-all *unwatch*)
  (add-watch
   *unwatch*
   (msg :warn "acc received: ~a" (acc 1))))

Author: Orm Finnendahl

Created: 2026-04-24 Fr 20:14

Validate