Skip to content
PyQt App for Arduino
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
.gitignore
LICENSE.md
README.md
pyduino.py
ui_pyduino.ui

README.md

PyDuino

PyQt App for Arduino

App Demo

demo

Arduino Code

#define led 13
#define baud 9600

void setup() {
  pinMode(led, OUTPUT);
  Serial.begin(baud);
}

void loop() { }
void serialEvent(){
  if (Serial.available() > 0){
    //
    String command = Serial.readStringUntil('\n');
    
    //Sending a reply after executing the function
    if (command.equals("on")) { digitalWrite(led, HIGH); Serial.println("LED ON"); }
    else if (command.equals("off")) { digitalWrite(led, LOW); Serial.println("LED OFF"); }
  }
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.