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

Mechanic37

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

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

Processing GUI Button से Led Control करें

December 25, 2022 by admin Leave a Comment

0
(0)
procesing gui led control करें

Graphical User Interface का use processing में करके दो Led के लिए चार button computer में बनाकर दोनों leds को control करना यह इस post में है जिसमे पहले मेने दो Leds को Arduino  से connect किया और Arduino को अपने computer से connect करके computer पर processing में Arduino के लिए graphical User Interface(GUI) का use कर चार button create किये जिन्हें Arduino से जोड़ा और उन buttons  उन leds को control किया 

Processing GuI से Button बनाकर led control करें

सभी step सही से follow करें में इस page को जल्दी में बना रहा हूँ कोई गलती हो तो comment में बताएं वैसे project to work कर रहा है पर language में problem हो सकती है project facebook,whatsapp पर share जरूर करें 


(adsbygoogle = window.adsbygoogle || []).push({});

Arduino क्या है ?

Circuit बनाएं Arduino और leds से

  • led1 की long pin connect करें Arduino की digital pin 12 से
  • Led1 short pin connect करें Arduino की Gnd pin से 
  • Led2 long pin connect करें Arduino digital pin 13 से
  • Led2 short pin connect करें Arduino Gnd pin से 

Control & theory Arduino+Processing GUI

पहली Led keyboard पर A press करने पर on और B key press करने पर off हो जाएगी दूसरी Led keyboard पर C press करने पर on और D key press करने पर off हो जाएगी

control circuit gui led in hindi

 सबसे पहले circuit बना के arduino को computer से connect करें और Arduino का

software launch करके नीचे Arduino के लिए दिया program upload करें और processing का software launce करके processing के लिए नीचे दिया program paste करें यह program Graphical User Interface(GUI) button window create करेगा 

Arduino led programming

Arduino ide को launch करें और इस program को Arduino board में upload करें 
Program Arduino में कैसे upload करते है ?
G

/* program for connect Graphical User Interface to Arduino board by 
Mechanic37
GUI1-Leds control
www.mechanic37.com
*/
int pin1=13;
int pin2=12;

void setup() {
  Serial.begin(9600); // Initialize Serial Communitication
  pinMode (13,OUTPUT); // Optional for Led Headlights, Reverse Lights, Etc.
  pinMode(12,OUTPUT);
}

void loop() {

if (Serial.available() > 0) //Listen for signal in the serial port
{
int data = Serial.read(); 
switch (data) { // Switch-case of the signals in the serial port
case ‘1’: // Case Number 1 is received, 
digitalWrite(13,HIGH);

break;
case ‘2’ : //// Case Number 2 is received, 
 digitalWrite(13,LOW);

break;
case ‘3’ : // Case Number 3 is received, 
 digitalWrite(12,HIGH);
break;
case ‘4’ : // Case Number 4 is received, 
 digitalWrite(12,LOW);
break;

case ‘5’: // Case Number 5 is received, 
 digitalWrite(13,HIGH);
 digitalWrite(12,HIGH);
default : break;

}
}
}

Program uplaod करने के बाद arduino को computer से connect रखें और gui create करें


(adsbygoogle = window.adsbygoogle || []).push({});

Processing में Button बनाएं Graphical User Interface (GUI) के लिये

GUI button processing led control करने के लिए

Processing launch करें और नीचे दिया program यह से copy करके processing में paste करें 
जब आप नीचे दिए program को play करेंगे तो ऐसी window create होगी जिस पर चार button है A,B,C,D keys press करने पर led on off होंगी graphical user interface create करने के लिए इसे processing software में paste करें और play button पर click करें 

/*Graphical User Interface by Mechanic37
GUI1-Leds control
www.mechanic37.com
*/

import processing.serial.*; //Importing the Serial library.
Serial myPort; 
int r,g,b; // initializing colours.

String M1= “ON”;
String M2= “OFF”;
String M3= “ON”;
String M4= “OFF”;
String M5= “MECHANIC37 GUI”; 

void setup()
{
 size(500,500);

 r = 0; 
 g = 0;
 b = 0;

println(Serial.list()); 
String portName = Serial.list()[0]; 
 myPort = new Serial(this, portName, 9600); // Initializing the serial port.
}

void draw()
{
   
 background(#CC6699);  
fill (255,255,255); 
fill(#279B61);
rect(90,125,300,130,20);
fill(255);
rect(115,150,100,75,5);
rect(265,150,100,75,5);
fill(#279B61);
rect(90,275,300,130,20);
fill(255);
rect(115,300,100,75,5);
rect(265,300,100,75,5);
textSize(20);
fill (255); 

text(“LED1-A,B”,200,145);
text(“LED2-C,D”,200,295);
textSize (30); 
fill (#216C09); 
text(M1, 140, 200); 
text(M2, 285, 200);
text(M3, 140, 350);
text(M4, 285, 350);
fill(#279B61);
text(M5, 100, 100);
}

void keyPressed()
{

 switch (keyCode) {  
   case ‘A’: 
  myPort.write(‘1’); 
 fill(255,0,0);
rect(100,150,100,75,5);

    break;
   case ‘B’:
myPort.write(‘2’);
fill(255,0,0);
rect(250,150,100,75,5);

     break; 
   case ‘C’:
myPort.write(‘3’);
fill(255,0,0);
rect(100,300,100,75,5);
  
   break;
   case ‘D’:
   myPort.write(‘4’);
  fill(255,0,0);
rect(250,300,100,75,5);
   
   break;
   default:
   break;
 }

}


(adsbygoogle = window.adsbygoogle || []).push({});

इन Projects को भी read करें 

  • PushButton के लिए Programming
  • Distance Sensor Programming
  • Dc Motor के लिए Programming
  • servo motor के लिए Programming
  • Led की brightness control करें 
  • Dc Motor की speed control कैसे करें
  • Voice Command के लिए Programming

दोनों Led on off हो रही है friends यह था simple GUI Project read करने के लिए thanks इस project को share करें अपने collage में facebook,whatsapp पर और Problem हो तो comment में लिखें facebook पर जुड़ें और page like करें –facebook

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

Average rating 0 / 5. Vote count: 0

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
  • भौतिक विज्ञान
  • इलेक्ट्रॉनिक इंजीनियरिंग
  • रसायन विज्ञान
  • जीव विज्ञान
  • कंप्यूटर सीखें
  • इंजीनियरिंग प्रोजेक्ट्स
  • ऑटोकैड टुटोरिअल