rglassett / ruby-cursor-game Goto Github PK
View Code? Open in Web Editor NEWBasic demo of arrow-key input in Ruby.
Basic demo of arrow-key input in Ruby.
I want to manipulate a v4l camera via uvcdynctrl (I can't use guvcview because I need to use the app with cheese or zoom etc).
So I want to select from the list of the camera controls with the UP and DOWN cursors, and then increase or decrease the value of the control with the LEFT and RIGHT cursors which would run the app with the new value.
The controls are:
uvcdynctrl -s "Brightness" 128
# Values : [ 0 .. 255, step size: 1 ],
# Default : 128
uvcdynctrl -s "Contrast" 128
# Values : [ 0 .. 255, step size: 1 ],
# Default : 128
uvcdynctrl -s "Saturation" 128
# Values : [ 0 .. 255, step size: 1 ],
# Default : 128
uvcdynctrl -s "White Balance Temperature, Auto" 1
# Values : [ 0 .. 1, step size: 1 ],
# Default : 1
uvcdynctrl -s "Gain" 128
# Values : [ 0 .. 255, step size: 1 ],
# Default : 0
uvcdynctrl -s "Power Line Frequency" 2
# Values : { 'Disabled'[0], '50 Hz'[1], '60 Hz'[2] },
# Default : 2
# uvcdynctrl -s "White Balance Temperature" 4000
# Values : [ 2000 .. 6500, step size: 1 ],
# Default : 4000
uvcdynctrl -s "Sharpness" 128
# Values : [ 0 .. 255, step size: 1 ],
# Default : 128
uvcdynctrl -s "Backlight Compensation" 0
# Values : [ 0 .. 1, step size: 1 ],
# Default : 0
uvcdynctrl -s "Exposure, Auto" 3
# Values : { 'Manual Mode'[1], 'Aperture Priority Mode'[3] },
# Default : 3
uvcdynctrl -s "Exposure (Absolute)" 250
# Values : [ 3 .. 2047, step size: 1 ],
# Default : 250
uvcdynctrl -s "Exposure, Auto Priority" 0
# Values : [ 0 .. 1, step size: 1 ],
# Default : 0
uvcdynctrl -s "Zoom, Absolute" 500
# Values : [ 100 .. 500, step size: 1 ],
# Default : 100
uvcdynctrl -s "Pan (Absolute)" 0
# Values : [ -36000 .. 36000, step size: 3600 ],
# Default : 0
uvcdynctrl -s "Tilt (Absolute)" 0
# Values : [ -36000 .. 36000, step size: 3600 ],
# Default : 0
uvcdynctrl -s "Focus (absolute)" 0
# Values : [ 0 .. 250, step size: 5 ],
# Default : 0
uvcdynctrl -s "Focus, Auto" 1
# Values : [ 0 .. 1, step size: 1 ],
# Default : 1
Negative values need "--" and space before the "-"
What do you think? I can see that some of the existing code could be re-used but I am not sure how to do the rest . .
Any help would be much appreciated! (and it would help learn a bit more Ruby).
Thanks,
Phil.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.