Bug 734855 - Arduino SDK does not take in to consideration code outside the setup rutine
Summary: Arduino SDK does not take in to consideration code outside the setup rutine
Keywords:
Status: CLOSED DUPLICATE of bug 688645
Alias: None
Product: Fedora
Classification: Fedora
Component: arduino
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Peter Oliver
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-31 16:07 UTC by Oliver Rivas
Modified: 2011-09-12 22:08 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-12 22:08:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
the Blink example with the modification and the original sample file (10.00 KB, application/x-tar)
2011-08-31 16:07 UTC, Oliver Rivas
no flags Details

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 ***


Note You need to log in before you can comment on or make changes to this bug.