[#XDUINO] #Arduino vs #Netduino vs #NetGadgeeter (II), use the Arduino



  1. Introduction, https://elbruno.com/2013/07/14/xduino-arduino-vs-netduino-vs-gadgeteer-i-2/


After the post of introduction today I start to create the app for example with Arduino. For this I have used the following hardware

The Arduino one Rev 3 is one of the most popular, and Groove kit, allows us to connect the sensors and actors to the plate in an easy way without having to deal with wires in craft.

As well with the hardware complete, the following is working with development tools. This is simpler:

The next step is to assemble the hardware, very simple step:

  • Connect LED to pin 6
  • Connect the BUTTON to pin 9


And we are going to create the application.

1. In Visual Studio 2012 created a new Arduino project


2. Once the project is created, select the board Arduino Uno with the menu “Tools / / Arduino / / Boards / / Arduino Uno”. From the same menu we select the COM port to connect our Arduino.


If you do not know to which port is connected to your arduino, this post can help you.

3 Add the application code

   1: const int buttonPin = 8; // the number of the pushbutton pin
   2: const int ledPin =  6;   // the number of the LED pin
   3: int buttonState = 0;     // variable for reading the pushbutton status
   4: bool ledState = false;
   6: void setup()
   7: {
   8:     pinMode(buttonPin, INPUT);     
   9:     pinMode(ledPin, OUTPUT);      
  10: }
  12: void loop()
  13: {
  14:     buttonState = digitalRead(buttonPin);
  15:     if (buttonState == HIGH)
  16:     {
  17:         ledState = !ledState;
  18:         delay(500);
  19:     }
  20:     if(ledState)
  21:     {
  22:         digitalWrite(ledPin, HIGH); // LED ON
  23:     }
  24:     else
  25:     {
  26:         digitalWrite(ledPin, LOW);  // LED OFF
  27:     }
  28: }

4. The code is quite simple, only I must highlight the following

-Then check the status of the Button (line 15) change the State of a flag by true or false and apply a delay from 500 to some reaction on the plate. If you do not add this delay click executes as many times as the loop pass by that function. There are more elegant ways of doing this, it is Winking smile

5 I display the application (F5!) In the output panel will see a message similar to the following (amazing app 1 Kb!)

Compiling ‘ Xduino02′ for ‘Arduino Uno’
Binary sketch size: 1274 bytes (4% of to 32256 byte maximum) (0.23 secs)
Uploading to I/O board using ‘ COM3′
Done uploading

6. My application is running (I leave the video that perhaps will become viral)

And ready, in 28 lines of code I have my application running. In the next post, we will see if we do the same with Netduino or .net Gadgeteer.

Saludos @ Home

El Bruno

image image image

1 comment

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: