• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Mechanic37

Mechanic37

इंजीनियरिंग और फिजिक्स,केमिस्ट्री

  • भौतिक विज्ञान
  • इंजीनियरिंग नोट्स
    • मैकेनिकल इंजीनियरिंग
    • इलेक्ट्रिकल इंजीनियरिंग
    • इलेक्ट्रॉनिक इंजीनियरिंग
    • इंजीनियरिंग प्रोजेक्ट्स
  • रसायन
  • जीव विज्ञान
  • कंप्यूटर
Home » Control Led With Computer key+ Processing GUI+ Arduino

Control Led With Computer key+ Processing GUI+ Arduino

December 25, 2022 by admin Leave a Comment

5
(1)
Control Led With Computer keyboard+ Processing GUI+ Arduino 

Control Led With Computer keyboard+ Processing GUI+ Arduino 

processing पर Graphical user Interface(gui) create कर के led को control करना computer के keyboard से यह एक छोटा सा project idea है जिसमे आप अपने computer का use करके किसी led को control keyboard का use करके कर सकते है 

Material-

Hardware

  • Arduino uno with usb cable 
  • computer
  • Led
  • jumper wire

software

  • Arduino 1.6.5 IDE
  • Processing3

What is Processing?

Processing एक open source programming Language है जो की Electronic Art के लिए integrated development environment(IDE) develop करती है या हम कह सकते है की processing से हम किसी Arduino board से communicate कर सकते है grafical user interface(GUI ) के through processing को download करें

GUI Theory And LED control

Led keyboard up arow key press करने पर on और Down arow key press करने पर off हो जाएगी सबसे पहले circuit बना के arduino को computer से connect करें और Arduino का software launce करके नीचे Arduino के लिए दिया program upload करें और processing का software launce करके processing के लिए नीचे दिया program paste करें यह program Graphical User Interface(GUI) create करेगा जिनसे आप led को control कर पाएंगे 

Arduino Electronic Circuit-

  • Led long pin को Arduino board की pin 13 से connect करें
  • Led short pin को Arduino board की pin Gnd से connect करें
  • arduinio को usb cable से computer से connect करें 

Programming-

पहले arduino uno के लिए और फिर GUI के लिए processing में code को direct copy paste करें

Arduino programming-

इस program को copy कर arduino software में paste करें और program arduino board में upload करें 

char val;                          // Data received from the serial port 

int ledPin = 13;                    // Set the pin to digital pin 13

void setup() { 

  pinMode(ledPin, OUTPUT);         // Set pin as OUTPUT 

  Serial.begin(9600);              // Start serial communication  

} 

void loop() { 

  if (Serial.available()) {        // If data is available to read, 

    val = Serial.read();           // read it and store it in val 

  } 

  if (val == ‘H’) {                // If H was received means 1,true

    digitalWrite(ledPin, HIGH);    // turn the LED on 

  } else { 

    digitalWrite(ledPin, LOW);     // turn it OFF

  } 

  delay(100);                      // Wait

} 

Programming for create Graphical user Interface(GUI)

इस program को copy करके processing में paste करें और top पर बना play का button पर click करे 

import processing.serial.*; 

Serial port;                      

 int r,g,b;

void setup() 

{ 

  size(500, 300); 

  r = 0; 

  g = 0;

  b = 0;

  noStroke(); 

  frameRate(10); 

  port = new Serial(this, 9600); 

} 

void draw() { 

background(#0D0C0D);

rect(140,130,100,70);

rect(250,130,100,70);

} 

void keyPressed()

{

  switch (keyCode) { 

    case UP: {

   port.write(‘H’); // Send the signal 1

  fill(#FFFCFD);

  rect(140,130,100,70);

 break;

    }

case DOWN:{

port.write(‘L’); // Send the signal 0

fill(#0D0C0D);

rect(250,130,100,70);

}

   default:

   break;

  }

}

ये दोनों program serial port के द्वारा जुड़े हुए है जब आप up arow key press करेंगे तब port ‘H’ receive करेगा जिसका मतलब Arduino के program में HIGH,1 या true है H receive होते ही led on हो जाएगी और processing में भी दो indicator rectangle में white हो जायेंगे और जैसे ही आप Down arow key press करेंगे तो serial port पर L write होगा जिससे condition false हो जाएगी और led off हो जाएगी 

यह पेज आपको कैसा लगा ?

Average rating 5 / 5. Vote count: 1

Share this:

  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to print (Opens in new window)

Filed Under: Remote Control

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

विषय

  • भौतिक विज्ञान
  • मैकेनिकल इंजीनियरिंग
  • इलेक्ट्रॉनिक्स इंजीनियरिंग
  • इलेक्ट्रिकल इंजीनियरिंग
  • रसायन विज्ञान
  • जीव विज्ञान 
  • कंप्यूटर 
  • इंजीनियरिंग प्रोजेक्ट्स

Footer

सोशल मीडिया पर जुड़ें

  • Facebook
  • Twitter
  • Instagram
  • Youtube

बनाना सीखें

  • ड्रोन कैसे बनाएं ?
  • रोबोट कैसे बनाएं ?
  • वेबसाइट कैसे बनाएं ?
  • एंड्राइड एप कैसे बनाएं ?

Policies

  • Shipping and Delivery
  • Refund and Cancellation Policy
  • Privacy Policy
  • Terms and Conditions

Shop

  • Shop
  • My account
  • Checkout
  • Cart

Mechanic37 2015 - 2024

  • साइटमैप
  • संपर्क करें
  • हमारे बारे में
  • विज्ञापन दें
  • Mechanical Notes
  • Electrical Notes
  • भौतिक विज्ञान
  • इलेक्ट्रॉनिक इंजीनियरिंग
  • रसायन विज्ञान
  • जीव विज्ञान
  • कंप्यूटर सीखें
  • इंजीनियरिंग प्रोजेक्ट्स
  • ऑटोकैड टुटोरिअल