Arduino Forum

Community => Website and Forum => Topic started by: conradin on Oct 23, 2012, 05:33 am

Title: [Solved]Loop Refference page
Post by: conradin on Oct 23, 2012, 05:33 am
Hi all,
I was just on the Loop reference page:
http://arduino.cc/en/Reference/Loop
When I tried the code example, I found the code wouldn't compile!
So I changed the code to this an it works!
Maybe someone should change that page to a working example?
Code: [Select]
int buttonPin = 3;

// setup initializes serial and the button pin
void setup()
{
 Serial.begin(9600);
 pinMode(buttonPin, INPUT);
}

// loop checks the button pin each time,
// and will send serial if it is pressed
void loop()
{
 if (digitalRead(buttonPin) == HIGH)
   Serial.write('H');
 else
   Serial.write('L');

 delay(1000);
}



I am in version 1.0.1 of Arduino, with an UNO board if that matters.
Perhaps the reference page is an old example?
Title: Re: Loop Refference page
Post by: marcello.romani on Oct 23, 2012, 02:36 pm
Please post the exact error messages you see (remember to enable verbose compiling).
Title: Re: Loop Refference page
Post by: marcello.romani on Oct 23, 2012, 02:37 pm
Sorry, spotted the error:

beginSerial(9600);

should be:

Serial.begin(9600);

And

serialWrite()

should be

Serial.write()
Title: Re: Loop Refference page
Post by: conradin on Oct 23, 2012, 04:28 pm
Ah, Yeah, Sorry.
I know whats wrong with it already. I'm just posting for a fix to the site example, because having working examples is important to me. Is there a better means to do this? Is the forum related to the website in such a way that this example might get fixed?
Title: Re: Loop Refference page
Post by: marcello.romani on Oct 23, 2012, 04:40 pm
Playground pages can be edited by registered users. Don't know about reference pages. I guess not... But hopefully some site admin will notice this thread and fix that page.  :)
Title: Re: Loop Refference page
Post by: conradin on Oct 24, 2012, 06:56 pm
I just realized that the pages on http://arduino.cc/en/Reference/HomePage
are inluded in the source package under: arduino/reference. Except HomePage is index.html.
I checked, and the loop example is wrong there too.
Is that a topic for the webmaster or the source code dev team?
Title: Re: Loop Refference page
Post by: Federico_Vanzati on Oct 24, 2012, 07:39 pm
This is an old legacy of the first version of the Arduino language!
Fixed, thanks for noticing!