Bug 734855

Summary: Arduino SDK does not take in to consideration code outside the setup rutine
Product: [Fedora] Fedora Reporter: Oliver Rivas <orvtech>
Component: arduinoAssignee: Peter Oliver <mavit>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: mavit
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-12 22:08:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
the Blink example with the modification and the original sample file none

Description Oliver Rivas 2011-08-31 16:07:04 UTC
Created attachment 520857 [details]
the Blink example with the modification and the original sample file

Description of problem:
- The SDK some times doesn't take in consideration code outside the setup() routine. 

Version-Release number of selected component (if applicable):
- arduino-0022-4.fc15.noarch
- On an Arduino Uno

How reproducible:
Every single time you try to run the 'blink' example code

Steps to Reproduce:
1. Open de Arduino SDK, load the 'Blink' example inside 'Basics'.
2. Compile and upload to the board.
3. Reboot the board.
  
Actual results:
LED on pin 13 doesn't blink

Expected results:
LED on pin 13 should be blinking

Additional info:
The work around for this code to work is to alter the example so it will look like this:

boolean done = true;
void setup() {      
  pinMode(13, OUTPUT);
  done = false;  
}

void loop() {
  digitalWrite(13, HIGH);   
  delay(1000);              
  digitalWrite(13, LOW);    
  delay(1000);              
}

The main difference between this and how it should be is that on this code one has to declare the variable 'done' and alter its value inside the setup() routine. 
To be honest I think it has to do with some optimization flags passed to the compiler or so.

Comment 1 Peter Oliver 2011-09-12 22:08:11 UTC

*** This bug has been marked as a duplicate of bug 688645 ***