Sketch #1 – Blink

This simple program is a good way to do your first test on Archiduino 1284. It turns on the LED on for one second, then off for one second, repeatedly. Meanwhile it gives some infos throughout the Arduino IDE serial monitor (SHIFT+CTRL+M)

NOTES

  1. LED is a keyword embedded in pins_arduino.h, the default pins assignment library that is loaded when you choose Archiduino1284 board on Arduino IDE. If you feel more comfortable with other definitions, you may use instead:
    – PD6
    – D9 (or simply 9)
  2. This firmware works ONLY with Arduino IDE 1.6.2.
  3. Logical state of the LED is inverted, so if you set it as LOW, the LED lights on.

Code

/*
// ===============================================
//   ARCHIDUINO 1284 Test Sketch
// ===============================================

//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------

  Sketch n.:    1
  Sketch title: Blink

  This sketch turns on the LED on for one second, then off for one second, repeatedly. Meanwhile
  it gives some infos throughout the serial monitor (SHIFT+CTRL+M)
  
  NOTES:
  LED is a keyword embedded in pins_arduino.h, the default pins assignment library  
  which is loaded when you choose Archiduino1284 board on Arduino IDE.
  You may use instead:
  - PD6
  - D9 (or simply 9)
  
  Logical state of the LED is inverted, so if you set it as LOW, the LED lights on.

//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------

  This software is published "as is", without technical support, and with no 
  warranty, express or implied, as to its usefulness for any purpose.  
  This example code is in the public domain.

//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
*/


//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------

void setup() {
  
  pinMode(LED, OUTPUT);   // initializing the digital pin as an output.
  Serial.begin(9600);     // initializing the serial port 0
  
}


//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------

void loop() {
  
  digitalWrite(LED, LOW);     // turns the LED on 
  Serial.println("LOW");      // gives some info throughout the serial monitor
  delay(1000);                // waits for 1000 ms
  digitalWrite(LED, HIGH);    // turns the LED off
  Serial.println("HIGH");     // gives some info throughout the serial monitor
  delay(1000);                // waits for 1000 ms
  
}



 


With this post we open the new category “Test files”, which is a sort of repository for testing and experimenting with Archiduino. Every test file contains the results of real experiments, not just theory. We hope this will be of any help to the growing family of Archiduino (and – why not? – Arduino) users. So, let’s start! (more…)