Skip to content

Small optimization of sample sketch in Arduino Yun Guide #1862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maghis opened this issue Feb 13, 2014 · 1 comment
Closed

Small optimization of sample sketch in Arduino Yun Guide #1862

maghis opened this issue Feb 13, 2014 · 1 comment
Assignees
Labels
Component: Documentation Related to Arduino's documentation content
Milestone

Comments

@maghis
Copy link

maghis commented Feb 13, 2014

I noticed that running the sample sketch in the Arduino Yun guide in the "The Console" paragraph, the intel cpu is hogged by the bridge python script running at 95%.

A simple fix would be to add a small delay in the sketch:

void loop() {
  // see if there's incoming serial data:
  if (Console.available() > 0) {
    // read the oldest byte in the serial buffer:
    incomingByte = Console.read();
    // if it's a capital H (ASCII 72), turn on the LED:
    if (incomingByte == 'H') {
      digitalWrite(ledPin, HIGH);
    } 
    // if it's an L (ASCII 76) turn off the LED:
    if (incomingByte == 'L') {
      digitalWrite(ledPin, LOW);
    }
  }
  delay(100);
}
@ffissore
Copy link
Contributor

Fixed. Thank you very much

@ffissore ffissore added this to the Release 1.5.6 milestone Feb 14, 2014
@ffissore ffissore self-assigned this Feb 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Related to Arduino's documentation content
Projects
None yet
Development

No branches or pull requests

2 participants