Skip to content

Instantly share code, notes, and snippets.

@brentpicasso
Created July 7, 2016 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brentpicasso/6b12ff6f7829c2efb798dde3577df7ad to your computer and use it in GitHub Desktop.
Save brentpicasso/6b12ff6f7829c2efb798dde3577df7ad to your computer and use it in GitHub Desktop.
--RPM simulator!
rpm = 0
rpmDir = 100
maxRpm = 10000
rpmId = addChannel("RPM", 10, 0, 0, 10000)
setTickRate(50)
function onTick()
setChannel(rpmId, rpm)
rpm=rpm + rpmDir
if rpm > maxRpm or rpm < 0 then rpmDir = -rpmDir end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment