Skip to navigation Skip to content
  • 1800 266 6123
  • Customer Support
  • My Orders
  • Track your order
  • My Account
    • My Account
    • My Cart
    • Checkout
Robu.in | Indian Online Store | RC Hobby | Robotics
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
0 ₹ 0.00
All Categories
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
  • Home
  • Shop
    • Shop
    • Featured Brands
    • Track your order
    • Payment Options
  • Forum
  • Bulk Enquiry
  • New Arrivals
  • ATL Kits Enquiry
  • Blogs
    • Blogs
    • Tutorials
    • Videos
  • BOM Tool
  • Careers
  • Sell on Robu
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
Robu.in | Indian Online Store | RC Hobby | Robotics
  • Search
  • 0
  • Home
  • Shop
  • Forum
  • Bulk Enquiry
  • New Arrivals
  • ATL Kits Enquiry
  • Blogs
  • BOM Tool
  • Careers
  • Sell on Robu
HomeBlogsDevelopment boardsRaspberry PiGPIO, Input & Output GUI panel using Tkinter

GPIO, Input & Output GUI panel using Tkinter

Raspberry Pi  0  comments  5571 Views  Tuesday, March 12, 2019











The article guides you through Designing a Graphical panel to control all the 21 GPIO’s of Raspberry Pi as an Input or Output Pin.

Passive
In this tutorial we will be Designing a Graphical panel through which we will be able to control all the 21 GPIO's of Raspberry Pi as an Input or Output Pin. Credits for the program - scotty3785, Original code link - click here Step 1 - Programming the Raspberry Pi
  • Open the python IDLE in Raspberry Pi and create a new Python file and enter the following code.
#This code has been published by Robu.in 
#visit https://robu.in for more information

import sys

if(sys.version_info[0]<3):
  from Tkinter import *
else:
  from tkinter import *

import RPi.GPIO as pi
import math
#import tkSimpleDialog

class LED(Frame):
"""A Tkinter LED Widget.
a = LED(root,10)
a.set(True)
current_state = a.get()"""
OFF_STATE = 0
ON_STATE = 1

   def __init__(self,master,size=10,**kw):
      self.size = size
      Frame.__init__(self,master,width=size,height=size)
      self.configure(**kw)
      self.state = LED.OFF_STATE
      self.c = Canvas(self,width=self['width'],height=self['height'])
      self.c.grid()
      self.led = self._drawcircle((self.size/2)+1,(self.size/2)+1,(self.size-1)/2)
   def _drawcircle(self,x,y,rad):
       """Draws the circle initially"""
       color="red"
       return self.c.create_oval(x-rad,y-rad,x+rad,y+rad,width=rad/5,fill=color,outline='black')
   def _change_color(self):
       """Updates the LED colour"""
       if self.state == LED.ON_STATE:
          color="green"
       else:
          color="red"
       self.c.itemconfig(self.led, fill=color)
   def set(self,state):
       """Set the state of the LED to be True or False"""
       self.state = state
       self._change_color()
   def get(self):
       """Returns the current state of the LED"""
       return self.state

## Future Functionality
##class gpioEdit(tkSimpleDialog.Dialog):
## """Dialog to be expanded to support advanced gpio features like
## - Pull Up / Pull Down Resistor Config
## - Debounce"""
## def __init__(self, master,gpio):
## top = self.top = Toplevel(master)
## if gpio.isInput():
## title = "Edit Input: %s" %(str(gpio.name))
## else:
## title = "Edit Output: %s" %(str(gpio.name))
## l = Label(top,text=title)
## b = Button(top, text="Submit", command=self.submit)
##
## l.grid(row=0)
## b.grid(row=1)
##
## def submit(self):
## print("Submitted")
## self.top.destroy()

class GPIO(Frame):
   """Each GPIO class draws a Tkinter frame containing:
   - A Label to show the GPIO Port Name
   - A data direction spin box to select pin as input or output
   - A checkbox to set an output pin on or off
   - An LED widget to show the pin's current state
   - A Label to indicate the GPIOs current function"""
   gpio_modes = ("Passive","Input","Output")

   def __init__(self,parent,pin=0,name=None,**kw):
      self.pin = pin
      if name == None:
         self.name = "GPIO %02d" % (self.pin)
         Frame.__init__(self,parent,width=150,height=20,relief=SUNKEN,bd=1,padx=5,pady=5)
         ##Future capability
         ##self.bind('<Double-Button-1>', lambda e, s=self: self._configurePin(e.y))
         self.parent = parent
         self.configure(**kw)
         self.state = False
         self.cmdState = IntVar()
         self.Label = Label(self,text=self.name)
         self.mode_sel = Spinbox(self,values=self.gpio_modes,wrap=True,command=self.setMode)
         self.set_state = Checkbutton(self,text="High/Low",variable=self.cmdState,command=self.toggleCmdState)
         self.led = LED(self,20)
         self.Label.grid(column=0,row=0)
         self.mode_sel.grid(column=1,row=0)
         self.set_state.grid(column=2,row=0)
         self.current_mode = StringVar()
         self.led.grid(column=3,row=0)

         self.set_state.config(state=DISABLED)
         function = self.getPinFunctionName()
         if function not in ['Input','Output']:
            self.mode_sel.delete(0,'end')
            self.mode_sel.insert(0,function)
            self.mode_sel['state'] = DISABLED

## def _configurePin(self, y):
## """Future capability to setup pull up/down"""
## new = gpioEdit(self.parent,self)

    def isInput(self):
       """Returns True if the current pin is an input"""
       return (self.mode_sel.get() == "Input")

    def setMode(self):
        """Sets the GPIO port to be either an input or output
       Depending on the value in the spinbox"""
       if (self.mode_sel.get() == "Input"):
          self.set_state.config(state=DISABLED)
          pi.setup(self.pin,pi.IN)
       elif (self.mode_sel.get() == "Passive"):
          self.set_state.config(state=DISABLED)
          pi.cleanup(self.pin)
       else:
          self.set_state.config(state=NORMAL)
          pi.setup(self.pin,pi.OUT)
          self.updateInput()

    def getPinFunctionName(self):
        pin = self.pin
        functions = {pi.IN:'Input',
                     pi.OUT:'Output',
                     pi.I2C:'I2C',
                     pi.SPI:'SPI',
                     pi.HARD_PWM:'HARD_PWM',
                     pi.SERIAL:'Serial',
                     pi.UNKNOWN:'Unknown'} 
        return functions[pi.gpio_function(pin)]

## Future Functionality
## def setPullUp(self,pullup):
## """Defines the GPIO as having a pull up resistor so the input
## state is inverted when read
## setPullUp(True) - Pin is pulled up
## setPullUP(False) - Pin is not pulled up"""
## self.pullup = pullup

   def toggleCmdState(self):
      """Reads the current state of the checkbox, updates LED widget
      and sets the gpio port state."""
      self.state = self.cmdState.get()
      self.updateLED()
      self.updatePin()

   def updatePin(self):
      """Sets the GPIO port state to the current state"""
      pi.output(self.pin,self.state)

   def updateLED(self):
      """Refreshes the LED widget depending on the current state"""
      self.led.set(self.state)

   def updateInput(self):
      """Updates the current state if the pin is an input and sets the LED"""
      if self.isInput():
         state = pi.input(self.pin)
         self.state = state
         self.updateLED()

class App(Frame):
   def __init__(self,parent=None, **kw):
      Frame.__init__(self,parent,**kw)
      self.parent = parent
      pi.setmode(pi.BCM)
      self.ports = []
     ## Get the RPI Hardware dependant list of GPIO
     gpio = self.getRPIVersionGPIO()
     for num,(p,r,c) in enumerate(gpio):
         self.ports.append(GPIO(self,pin=p))
         self.ports[-1].grid(row=r,column=c)
         self.update()

   def onClose(self):
       """This is used to run the Rpi.GPIO cleanup() method to return pins to be an input
       and then destory the app and its parent."""
       try:
           pi.cleanup()
       except RuntimeWarning as e:
           print(e)
           self.destroy()
           self.parent.destroy()

    def readStates(self):
        """Cycles through the assigned ports and updates them based on the GPIO input"""
        for port in self.ports:
            port.updateInput()

    def update(self):
        """Runs every 100ms to update the state of the GPIO inputs"""
        self.readStates()
        self._timer = self.after(100,self.update)
   def getRPIVersionGPIO(self):
       """Returns the GPIO hardware config for different Pi versions
       Currently supports layout 1 and 3"""
       gpio1 = ((0,0,0),
                (1,1,0),
                (4,2,0),
                (17,3,0),
                (21,4,0),
                (22,5,0),
                (10,6,0),
                (9,7,0),
                (11,8,0),
                (14,0,1),
                (15,1,1),
                (18,2,1),
                (23,3,1),
                (24,4,1),
                (25,5,1),
                (8,6,1),
                (7,7,1))
       gpio2 = ((2,0,0),
                (3,1,0),
                (4,2,0),
                (17,3,0),
                (27,4,0),
                (22,5,0),
                (10,6,0),
                (9,7,0),
                (11,8,0),
                (14,0,1),
                (15,1,1),
                (18,2,1),
                (23,3,1),
                (24,4,1),
                (25,5,1),
                (8,6,1),
                (7,7,1))
       gpio3 = ((2,0,0),
                (3,1,0),
                (4,2,0),
                (17,3,0),
                (27,4,0),
                (22,5,0),
                (10,6,0),
                (9,7,0),
                (11,8,0),
                (5,9,0),
                (6,10,0),
                (13,11,0),
                (19,12,0),
                (26,13,0),
                (14,0,1), 
                (15,1,1),
                (18,2,1),
                (23,3,1),
                (24,4,1),
                (25,5,1),
                (8,6,1),
                (7,7,1),
                (12,8,1),
                (16,9,1),
                (20,10,1),
                (21,11,1))
   if pi.RPI_REVISION == 3:
      gpio = gpio3
      self.parent.title('Raspberry Pi GPIO - A+/B+/2B+')
   elif pi.RPI_REVISION == 2:
        #Change this when I know the pins on RPi GPIO Version 2
        gpio = gpio2
        self.parent.title('Raspberry Pi GPIO - A/B Rev2')
   elif pi.RPI_REVISION == 1:
        self.parent.title('Raspberry Pi GPIO - A/B')
        gpio = gpio1
   else:
        self.parent.title('Raspberry Pi GPIO - Unknown Version')
        ##Assume same config as A+/B+/2B+
        gpio = gpio3
        return gpio

def main():
    root = Tk()
    root.title("Raspberry Pi GPIO")
    a = App(root)
    a.grid()
    """When the window is closed, run the onClose function."""
    root.protocol("WM_DELETE_WINDOW",a.onClose)
    root.resizable(False,False)
   root.mainloop()

if __name__ == '__main__':
   main()
  • Now save the program. We are saving it as gpio.py python file.

Step 2 - Running the program and Understanding the GUI panel
  • Now open terminal and type command sudo python gpio.py to run the program.
  • A panel window will open up like this -
  • From here you can set the status of any GPIO pin from the Corresponding drop down menu as Passive, Input or Output.
  • If you have selected Output, then you will have to mark or unmark the corresponding High/Low box to make the Pin Low or High
  • If you have selected Input, then the low Input will show the the Red colour and if input is high, it will show  Green Colour.
Now you can Explore the more of a GUI with Tkinter. For more on tkinter you can visit - https://wiki.python.org/moin/TkInter

Tags : Raspberry Pi Article

Share This Article


About Robu

Robu Single Logo

India's biggest robotics E-commerce company. Robu deals with Arduino, Raspberry Pi, Sensors, Drone parts, 3D printer parts, E-bike accessories and Electronics components etc. Click here to explore range of Robotics products available at Robu. Also, do not forget to follow us on Facebook, Instagram and YouTube because we are constantly contributing to the community by creating content around Arduino, Raspberry Pi, Drones, Sensors etc.


Related Posts

card image
Best Raspberry Pi Apps for Electronics Engineers

 Monday March 2, 2020      3749 Views

Here's a list of the best Raspberry Pi apps for Electronics Engineers, that includes SmartSim, USBprog, PCB, and many more.... Read More

card image
Raspberry Pi Pico - Every Feature You Need in A Budget Friendly Microcontroller

 Thursday January 21, 2021      4209 Views

The Raspberry Pi Foundation has launched their first own dual-core ARM Cortex M0+ processor-based smallest-sized and budget-friendly Single Board Computer named as Raspberry Pi Pico.... Read More

card image
IOT Enabled Energy Meter

 Friday December 22, 2023      1233 Views

Today we are going to build an IOT Enabled Energy Meter using Raspberry Pi Pico and Arduino Nano so that we can monitor energy consumed from anywhere. We’ll be using... Read More

card image
GUI Designing On Raspberry Pi Using Tkinter And Python

 Saturday November 28, 2020      4099 Views

Design your own GUI on Raspberry Pi using Tkinter and Python in this step by step guide.... Read More

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

Search Post


Related Posts

Raspberry Pi Pico - Every Feature You Need in A Budget Friendly Microcontroller
Blinking LED using GPIO pins of RaspberryPi
Unveiling the New Raspberry Pi 5 2GB
Orange Raspberry Pi Zero 2W Basic Kit


Subscribe to our Newsletter
to get promotional offers & discounts
Robu.in | Indian Online Store | RC Hobby | Robotics
Got Questions ? Call us between 9:15 AM to 6:15 PM Monday-Saturday 1800 266 6123, 020 68197600

Information

  • Track Your Order
  • Videos
  • FAQ
  • Careers

My Account

  • Cart
  • Checkout
  • My Account
  • Payment Options

Services

  • ABOUT US
  • Contact Us
  • Robu B2B

Policies

  • Investor Relations
  • MACFOS CSR
  • Privacy policy
  • Terms of Service
  • Shipping & Refund
  • E-Waste Collection

Download Our App

google-play-badge
iOS App Link
© Robu.in is registered trademark of MACFOS LIMITED - All Rights Reserved

Subscribe to our Newsletter

Information

  • Track Your Order
  • Videos
  • FAQ
  • Careers

My Account

  • Cart
  • Checkout
  • My Account
  • Payment Options

Why Choose us

  • ABOUT US
  • Contact Us
  • Robu B2B

Policies

  • ABOUT US
  • Shipping & Refund Policy
  • Terms of Service
  • Privacy policy
  • Shipping Time / Delivery Time
  • Guarantee/Warranty
  • Changing or Canceling An Order
  • Payment Options
  • MACFOS LIMITED CSR
  • Investor Relations

Download Our App

google-play-badge
Robu.in | Indian Online Store | RC Hobby | Robotics
Got Questions ? Call us between 9:15 AM to 6:15 PM Monday-Saturday 1800 266 6123, 020 68197600

Plese Fill this details