Things used in this project

Hardware components:
Pi 3 02
Raspberry Pi 3 Model B
×1
09590 01
LED (generic)
×1
11026 02
Jumper wires (generic)
×1
12002 04
Breadboard (generic)
×1

Schematics

Conncection between pi and LED
Simpl iza7zc8bch

Code

telegrambot.pyPython
#coder :- Salman Faris

import sys
import time
import random
import datetime
import telepot
import RPi.GPIO as GPIO

#LED
def on(pin):
        GPIO.output(pin,GPIO.HIGH)
        return
def off(pin):
        GPIO.output(pin,GPIO.LOW)
        return
# to use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BOARD)
# set up GPIO output channel
GPIO.setup(11, GPIO.OUT)

def handle(msg):
    chat_id = msg['chat']['id']
    command = msg['text']

    print 'Got command: %s' % command

    if command == 'on':
       bot.sendMessage(chat_id, on(11))
    elif command =='off':
       bot.sendMessage(chat_id, off(11))

bot = telepot.Bot('Bot Token')
bot.message_loop(handle)
print 'I am listening...'

while 1:
     time.sleep(10)

Credits

10565075 614694575316976 4077841016889052230 n
Salman Faris

sudo rm -rf /

Replications

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Running Native .NET Core Apps on Raspberry Pi (ARM)
Easy
  • 2,435
  • 28

Protip

Finally you can run your .NET Core apps on ARM versions of Ubuntu 16.04, 14.04 and Windows 10 IoT. We'll be making a Pi calculation app.

The $10 RPi Zero W - First Impressions
Easy
  • 6,822
  • 14

Protip

Seriously, can a $10 Raspberry Pi Zero-W actually perform useful work? I'm typing this while the "W" is streaming YouTube to my HDMI 4K TV.

PlatformIO for Visual Studio Code
Easy
  • 536
  • 5

Protip

PlatformIO is an open source ecosystem for IoT development. And now, PlatformIO for Visual Studio Code is coming!

Binary IP address display for Raspberry Pi
Easy
  • 291
  • 5

Full instructions

Using a Unicorn pHAT we can easily display the IP address in binary when the Raspberry Pi boots!

Run Dropbox on Raspberry Pi
Easy
  • 142
  • 3

Protip

Host files with popular app Dropbox on your Raspberry Pi device. Easy and fast step-by-step guide.

Network Monitoring using R-Pi and Node Red
Easy
  • 1,438
  • 10

Work in progress

Using the R-Pi 3 and Node Red I created a simple network monitoring appliance.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback