dj0tt / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

New IDE Examples please! (one included) #1059

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

It would be good if you could add more examples. Attached is a modification of 
the "Fade" example. This example also prints the current brightness to the 
Serial console.

Original issue reported on code.google.com by ad...@mdtech.us on 3 Oct 2012 at 3:01

Attachments:

GoogleCodeExporter commented 9 years ago
Also, attached is a modification of the "Blink" example. This version also 
prints "LED On" or "LED Off" to the console.

Original comment by ad...@mdtech.us on 3 Oct 2012 at 3:14

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 3 Oct 2012 at 12:51

GoogleCodeExporter commented 9 years ago
PLEASE correct comments in Fade-with_console_output.ino

They refer to pin 9 but the code actually use pin 11

(As an aside a comment like "// declare pin 9 to be an output:" just preceeding 
"pinMode(led, OUTPUT);" is not only redundant, but, as seen in this example, 
troublesome. 
Similarly "// start serial port at 9600 bps:" , "  // set the brightness of pin 
9:" 
They actually make the source LESS readable as they reduce the significant 
lines of code viewable on the screen.) 

Original comment by jaguar3s...@gmail.com on 3 Oct 2012 at 2:16

GoogleCodeExporter commented 9 years ago
Ok, attached is the code with modified comments.

Original comment by ad...@mdtech.us on 3 Oct 2012 at 8:46

Attachments:

GoogleCodeExporter commented 9 years ago
The reasoning behind the current examples was to do just one thing in each of 
the basics.  For that reason I would prefer not to add printing to Blink and 
Fade.

In general, though we do add new examples when we add new features, we've tried 
to keep the number of examples that are in the downloaded IDE small, so as not 
to add to the overall download size.  There are many more examples in the 
playground and on the main Arduino.cc site. The question that I would ask about 
each example added to the downloaded IDE is this:  What does this example show 
that no other example shows?  If it is an expansion or a repetition, can it be 
placed in the online site instead of in the downloaded IDE?

Original comment by tom.i...@gmail.com on 3 Oct 2012 at 10:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Additional information regarding this example:

PROBLEM: The test which includes
brightness == 60
should be
brightness > 60
since it will brightness will never be equal to 60 if user modifies program to 
use 
fadeAmount = 7;
Limit test are always better with "greater than" or "greater than or equal" (or 
less...).

Why did you choose to use 
double brightness = 0;
better to use 
int brightness = 0;

Note that "double implementation on the Arduino is currently exactly the same 
as the float", "Floating point math is also much slower", "may yield strange 
results when compared" (I would prefer the word unexpected instead of "strange".

Regarding "the built-in LED on pin 13". Be advised that not all Arduino boards 
use D13 as LED_BUILTIN (Arduino ethernet uses D9). Perhaps this example should 
use a totally different pin.

Original comment by jaguar3s...@gmail.com on 4 Oct 2012 at 11:33

GoogleCodeExporter commented 9 years ago
As mentioned above examples add to the complexity of both the blink and the 
fade examples unnecessarily. In the basic examples, we've kept example to 
introducing one concept. These require teachers not only to explain blink and 
fade, but also serial, in the same example.

I would prefer to keep the basic examples single-concept and short, as many 
teachers have requested that. You are welcome to post these examples to the 
playground, but I think they don't add sufficient value to the existing 
examples.

Original comment by tom.i...@gmail.com on 4 Oct 2012 at 11:43

GoogleCodeExporter commented 9 years ago
ok, here is one last suggestion. If you CAN make more examples, please make a 
separate download with more examples so if people want more examples, they 
could download some extra ones.

Original comment by ad...@mdtech.us on 4 Oct 2012 at 7:53