button. Object

The button. object icon

All programmable boards, programmable serial controllers, and Tibbo Project System (TPS) devices offered by Tibbo feature a button referred to as the "setup" or "MD" button ("MD" stands for "mode"). All Tibbo programmable modules have a line for connecting this button externally.

The setup button has a special system function: powering-up a Tibbo device with this button pressed (on modules, the MD line held LOW) causes the device to enter the firmware upgrade mode. This mode is for uploading new TiOS (firmware) into the device. The second system function of the MD button is to bypass forgotten passwords.


When a programmable Tibbo device is executing a Tibbo BASIC/C application, the MD button can be used as a general-purpose input button.

The button. object offers the following:

Tibbo BASIC
Tibbo C
sub on_button_released()
   if button.time>4 then
      'the button was pressed for a "long" time -- do one thing
   else
      'the button was pressed for a "short" time -- do another thing
   end if
end sub
void on_button_released(){
   if(button.time>4){
      //the button was pressed for a "long" time -- do one thing
   }   
   else{
      //the button was pressed for a "short" time -- do another thing
   }
}

The button does not require any pre-configuration.

Note that the on_button_pressed and on_button_released events, as well as the button.time read-only property utilize "debouncing," which filters out very short transitions of the button state.

The button.pressed read-only property, however, bypasses the debouncing algorithm to return the immediate state of the button at the very moment the property is read.