Subdomain Posts
None | 10 days ago
None | 10 days ago
None | 10 days ago
None | 10 days ago
JavaScript | 21 days ago
JavaScript | 24 days ago
JavaScript | 25 days ago
JavaScript | 25 days ago
None | 25 days ago
None | 33 days ago
Recent Posts
None | 3 sec ago
CAD Lisp | 8 sec ago
PAWN | 26 sec ago
None | 31 sec ago
None | 50 sec ago
None | 54 sec ago
Make | 54 sec ago
None | 2 min ago
None | 2 min ago
PHP | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 9th of Jun 2009 08:40:53 AM Download | Raw | Embed | Report
  1.  
  2. --Placing the phone face down will disable the ringer. Turning it face up again will enable
  3. --the ringer.
  4. require "android"
  5. android.startSensing()
  6. android.sleep(1)  --Give the sensors a moment to come online.
  7. silent = false
  8. while true do
  9.   s = android.readSensors()
  10.   facedown = s.result and s.result.zforce and s.result.zforce > 9
  11.   if facedown and not silent then
  12.     android.vibrate()  --A short vibration to indicate we're in silent mode.
  13.     android.setRingerSilent(true)
  14.     silent = true
  15.   elseif not facedown and silent then
  16.     android.setRingerSilent(false)
  17.     silent = false
  18.   end
  19.   android.sleep(1)
  20. end
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: