(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[category:Explore M3]]
 
[[category:Explore M3]]
 
Blinking an LED is fun for a newbie, a setup test for a Embedded Developer and for this tutorial it getting started with Explore M3 and answering some basic questions like, ''where did it come from?'' which are usually ignored if it is programming just with Arduino.
 
Blinking an LED is fun for a newbie, a setup test for a Embedded Developer and for this tutorial it getting started with Explore M3 and answering some basic questions like, ''where did it come from?'' which are usually ignored if it is programming just with Arduino.
 +
[[File:0 Led m3.jpg]]
  
I would recommend you to go  through [[Explore_M3_Introduction|the board introduction]] and [[Arduino_Setup_for_Explore_M3|setup tutorial]] before proceeding with this one.
+
=The Example=
 
+
I would recommend you to go  through [[Explore_M3_Introduction|the board introduction]] and [[Arduino_Setup_for_Explore_M3|setup tutorial]] before proceeding with this one. Explore M3 has an on board blue led connected to pin 13. It is indicated by ''6'' in figure.So there is no physical hookup required for tutorial.
Explore M3 has an on board blue led connected to pin 13. So there is no physical hookup required for tutorial.
+
[[File:0 Explore M3 HW Marking.png|center]]
 
+
 
Even the code, as you might now is there in the IDE. You may select as shown below:
 
Even the code, as you might now is there in the IDE. You may select as shown below:
 +
 
[[File:Blink m3.png|none]]
 
[[File:Blink m3.png|none]]
 
The code in all its glory!
 
The code in all its glory!
Line 24: Line 25:
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
=A few questions=
 +
Now that we are happy with the blinky, here are some questions! You may skip them if they do not serve your purpose. However if you want to '''''take it beyond''''', here we go!
 +
 +
* '''If Arduino programming is indeed C++, why don't I see any header files? Where did the '''setup()''' and '''loop()''' function come from?'''
 +
**Well, the answer is they are still there but they are hidden. The extension the program/sketch file is .ino but there is an accompanying C++ file that has all the header files and other dependencies. The next obvious question is where is that file? But wait, you don't really need to know in which temp folder that exists; what I think you need to know is how can I get away with this. The answer is try the [[LED_Blinking_With_Explore_M3|blinky on bare metal with this tutorial.]] This tutorial may not directly answer the question, but will set you up in the right direction.
 +
 +
*'''What compiler does this thing use?'''
 +
** It's the open source ARM GCC, check this tutorial on how to set this up and use it directly.
 +
 +
*'''How is the program uploaded to the board?''' 
 +
**Explore M3 uses a utility called DFU-Util,  other arduino boards might use some thing else. As with ARM GCC, you may as well set this thing independently.
 +
 +
I hope you've enjoyed this curious blinky ride, I know there may be a lot of relevant questions popping up. So go ahead and explore, and comment below any question or comment, little or big, complex or silly!
 +
 +
=Video Tutorial=
 +
<html>
 +
<div class="embed-responsive embed-responsive-16by9">
 +
    <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/8mFIKMPgMQY?list=PLRuRKN7_FVguJdF-riEXE542lVSJLhDk2"></iframe>
 +
</div>
 +
</html>
 +
 +
{{DISQUS}}

Latest revision as of 12:56, 15 June 2016

Blinking an LED is fun for a newbie, a setup test for a Embedded Developer and for this tutorial it getting started with Explore M3 and answering some basic questions like, where did it come from? which are usually ignored if it is programming just with Arduino. 0 Led m3.jpg

The Example

I would recommend you to go through the board introduction and setup tutorial before proceeding with this one. Explore M3 has an on board blue led connected to pin 13. It is indicated by 6 in figure.So there is no physical hookup required for tutorial.

0 Explore M3 HW Marking.png

Even the code, as you might now is there in the IDE. You may select as shown below:

Blink m3.png

The code in all its glory!

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}
 
// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(100);              // wait for a second
}

A few questions

Now that we are happy with the blinky, here are some questions! You may skip them if they do not serve your purpose. However if you want to take it beyond, here we go!

  • If Arduino programming is indeed C++, why don't I see any header files? Where did the setup() and loop() function come from?
    • Well, the answer is they are still there but they are hidden. The extension the program/sketch file is .ino but there is an accompanying C++ file that has all the header files and other dependencies. The next obvious question is where is that file? But wait, you don't really need to know in which temp folder that exists; what I think you need to know is how can I get away with this. The answer is try the blinky on bare metal with this tutorial. This tutorial may not directly answer the question, but will set you up in the right direction.
  • What compiler does this thing use?
    • It's the open source ARM GCC, check this tutorial on how to set this up and use it directly.
  • How is the program uploaded to the board?
    • Explore M3 uses a utility called DFU-Util, other arduino boards might use some thing else. As with ARM GCC, you may as well set this thing independently.

I hope you've enjoyed this curious blinky ride, I know there may be a lot of relevant questions popping up. So go ahead and explore, and comment below any question or comment, little or big, complex or silly!

Video Tutorial