mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 02:30:38 -08:00
revision of example 'tilt-sensor'
This commit is contained in:
parent
d8e26b05cf
commit
1444d1639b
2 changed files with 5 additions and 4 deletions
|
|
@ -13,8 +13,10 @@
|
|||
+w+)))
|
||||
(normalize (x)
|
||||
(* (to-pos x) +w+)))
|
||||
(let* ((dx (min (* 0.2 x-rotation) (1- +w+)))
|
||||
(dy (min (* 0.2 y-rotation) (1- +w+)))
|
||||
;; x axis rotation changes y
|
||||
;; y axis rotation changes x
|
||||
(let* ((dx (min (* 0.2 y-rotation) (1- +w+)))
|
||||
(dy (min (* 0.2 x-rotation) (1- +w+)))
|
||||
(add-x (add dx))
|
||||
(add-y (add dy)))
|
||||
(if (aref *maze*
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ Rectangle {
|
|||
interval: 30
|
||||
repeat: true
|
||||
|
||||
// reversed: x axis changes y position, y axis changes x position
|
||||
onTriggered: Lisp.call("maze:move", tilt.reading.yRotation, tilt.reading.xRotation)
|
||||
onTriggered: Lisp.call("maze:move", tilt.reading.xRotation, tilt.reading.yRotation)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue