Sha256: 124ca162f05aa57d7f775c832e0e3597c723cde01346726c09239a19ab4d8407

Contents?: true

Size: 956 Bytes

Versions: 10

Compression:

Stored size: 956 Bytes

Contents

//###############################################
//------------------- Button --------------------

const BUTTON_REBOOT = 3000;; //ms MIN 50ms
var button_pressed  = 0;;

fun buttonPressedUrl data=
  strcatlist confGetServerUrl::apiPath::"/button-pressed.jsp?duration="::(itoa data)::nil;;

//-------------------------------------------------------------

fun buttonCheck =
  if (button2 > 0) then
  (
    if button_pressed == 0 then
    (
      set button_pressed = time_ms
    )
    else if (time_ms - button_pressed) > BUTTON_REBOOT then
    (
      buffersFill 0 4 "\255"
    )
  )
  //reboot only when button not pressed, otherwise we get into setup mode
  else if button_pressed > 0 then
  (
    if (time_ms - button_pressed) > BUTTON_REBOOT then
    (
      exit;
      set button_pressed = 0
    )
    else
    (
      httprequest "GET" buttonPressedUrl (time_ms - button_pressed) "" #_cbHttp HTTP_NORMAL;
      set button_pressed = 0
    )
  )
;;

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nabaztag_hack_kit-0.1.0 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.beta8 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.beta3 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.beta2 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.beta1 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.alpha7 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.alpha6 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.alpha5 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.alpha4 bytecode/lib/button.mtl
nabaztag_hack_kit-0.1.0.alpha3 bytecode/lib/button.mtl