New toy arrived!!!

Posted on Jan 27, 2014

Recently, a new toy arrived:
Arduino MEGA2560

So it’s a good opportunity to create new category

As is written in [Disclaimer][2] - I do not take any complaints if You brake anything following my blog.
It doesn’t matter if You order arduino or funduino (china clone of arduino), it’s opensource project, and You can still use development tools from official arduino.cc site.
Arduino IDE is here.
So first task is to check if it works :)

Arduino MEGA 2560 has orange led on board, so for ‘first touch’ You don’t need to do anything with hardware, only to connect to computer via usb.

Load IDE:
Arduino IDE

Code is very minimal. Arduino IDE allows to program with simplified Cpp, so it’s a lot of easier for begginers, to start.
code:

  pinMode(13, OUTPUT);
}

void loop () {
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
  delay(1000);
}

Every Arduino code MUST have two functions (that’s most minimum You can have): setup and loop.
setup() function is executed on arduino start (reset), and after that, loop() is executed again and again and again…
So in setup we set pin 13 (the one that has orange led on board) for output.
And in loop we give 13 pin HIGH signal (5V or on), delay 1second (1000ms), then 13 pin LOW signal (0V or off) and delay again. That’s it.
Press upload the code and vuolia - expensive blinker:
http://youtu.be/zgtsiUofoVg