« Back to project details
Newest
-
"Casing"
11/02/2014 at 21:36 • 0 comments -
Colour-key -- yet another use case
08/26/2014 at 18:58 • 0 commentsThis might be quite useful. A key that can be programmed to change colours when turning and enter a colour-dependent phrase when pressed:
while true do x=rot.pos() i=x/4%8+1 pressed=sw.get() if i==1 then led.rgb(1.0,0.0,0.0) if pressed then hid.hit("red") end elseif i==2 then led.rgb(0.0,1.0,0.0) if pressed then hid.hit("green") end elseif i==3 then led.rgb(0.0,0.0,1.0) if pressed then hid.hit("blue") end elseif i==4 then led.rgb(1.0,1.0,0.0) if pressed then hid.hit("yellow") end elseif i==5 then led.rgb(0.0,1.0,1.0) if pressed then hid.hit("cyan") end elseif i==6 then led.rgb(1.0,0.0,1.0) if pressed then hid.hit("purple") end elseif i==7 then led.rgb(1.0,0.5,0.5) if pressed then hid.hit("pink") end elseif i==8 then led.rgb(1.0,1.0,1.0) if pressed then hid.hit("white") end end if pressed then while sw.get() do end end end
... of course instead of writing the colour name, one could start applications, enter passwords (not really save though...), etc.
-
Use cases
08/20/2014 at 23:20 • 0 commentsI was told, correctly, to come up with some use cases... find them on the project details!