> For the complete documentation index, see [llms.txt](https://doc.open-tx.org/opentx-2-2-lua-reference-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.open-tx.org/opentx-2-2-lua-reference-guide/part_iii_-_opentx_lua_api_reference/lcd_functions/drawswitch.md).

# lcd.drawSwitch(x, y, switch, flags)

Draw a text representation of switch at (x,y)

@status current Introduced in 2.0.0

### Parameters

* `x,y` (positive numbers) starting coordinate
* `switch` (number) number of switch to display, negative number displays negated switch
* `flags` (unsigned number) drawing flags, only SMLSIZE, BLINK and INVERS.

### Return value

none

## Examples

[lcd/drawSwitch-example](https://raw.githubusercontent.com/opentx/lua-reference-guide/opentx_2.2/lcd/drawSwitch-example.lua)

```lua
local function run(event)
  local source
  lcd.clear()
  lcd.drawText(1, 1,"drawSwitch() example", 0)
  for source = 1, 5 do
   lcd.drawSwitch(1, source * 10, source, 0)
   lcd.drawText(20, source * 10, " is switch source number " .. source)
  end
end

return{run=run}
```

![](https://3605924701-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRzpA5C06zjyxDVfHVi%2Fsync%2Ffbbbfcbc6fa4f3e0746cd19a71058892dcc7b1d9.png?generation=1611683719597144\&alt=media)
