This should help:
function printf(s,...)
print(string.format(s,...))
end
function api_tests()
menu.close()
console.clear()
console.show()
printf("Testing module 'camera'...")
printf("Camera : %s (%s) %s", camera.model, camera.model_short, camera.firmware)
printf("Shoot mode: %s", camera.mode)
printf("Shutter : %s (raw %s, %ss, %sms, apex %s)", camera.shutter, camera.shutter.raw, camera.shutter.value, camera.shutter.ms, camera.shutter.apex)
printf("Aperture : %s (raw %s, 1/%s, apex %s)", camera.aperture, camera.aperture.raw, camera.aperture.value, camera.aperture.apex)
printf("ISO : %s (raw %s, %s, apex %s)", camera.iso, camera.iso.raw, camera.iso.value, camera.iso.apex)
printf("EC : %s (raw %s, %s EV)", camera.ec, camera.ec.raw, camera.ec.value)
printf("Flash EC : %s (raw %s, %s EV)", camera.flash_ec, camera.flash_ec.raw, camera.flash_ec.value)
printf("Kelvin : %s", camera.kelvin)
key.wait()
console.hide()
end
keymenu = menu.new
{
name = "Script API tests",
select = function(this) task.create(api_tests) end,
}
I used it to check the lua_fix branch, and also wanted to change some values before giving the green light and including it in the nightly.
Note this script is not exactly compatible with the nightly (I did some tweaks to the API), so just compile the lua_fix branch before trying it.
Extensions to this script are welcome.