#FOX Board D27 and Telegram


	from telegram import Update
	from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
	import gpiod
	import time
	
	chip=gpiod.Chip('gpiochip0')
	led1 = gpiod.find_line("PB24")
	led2 = gpiod.find_line("PB25")
	lines = chip.get_lines([led1.offset()])
	lines.request(consumer='foobar', type=gpiod.LINE_REQ_DIR_OUT, default_vals=[0])
	
	async def led1on(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
	        print("Led 1 on")
	        await update.message.reply_text(f'Led 1 on')
	        lines.set_values([1])
	
	async def led1off(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
	        print("Led 1 off")
	        await update.message.reply_text(f'Led 1 off')
	        lines.set_values([0])
	
	app = ApplicationBuilder().token("TOKEN").build()
	
	app.add_handler(CommandHandler("led1on", led1on))
	app.add_handler(CommandHandler("led1off", led1off))
	
	app.run_polling()



* python-telegram-bot
	* <https://python-telegram-bot.org/>
	* Repository su GitHub <https://github.com/python-telegram-bot/python-telegram-bot>
* <https://web.telegram.org/k/#@foxboardbot>
* <https://www.acmesystems.it/libgpiod>