Difference between revisions of "User:Allifreyr"

From Fab Lab Wiki - by NMÍ Kvikan
Jump to: navigation, search
Line 2: Line 2:
  
 
Hef áhuga fyrir því að prófa allt sem er hérna og sjá hvort ég sé með einhvern áhuga á því. Ég hallast samt að því að læra forritun eða kerfisfræði seinna.
 
Hef áhuga fyrir því að prófa allt sem er hérna og sjá hvort ég sé með einhvern áhuga á því. Ég hallast samt að því að læra forritun eða kerfisfræði seinna.
 +
 +
/*
 +
  Blink
 +
  Turns on an LED on for one second, then off for one second, repeatedly.
 +
 +
  This example code is in the public domain.
 +
  */
 +
  // Pin 13 has an LED connected on most Arduino boards.
 +
  // give it a name:
 +
  int tomato = 12;
 +
  int kotl = 11;
 +
  int rubick = 10;
 +
  // the setup routine runs once when you press reset:
 +
  void setup() {               
 +
  // initialize the digital pin as an output.
 +
  pinMode(tomato, OUTPUT);
 +
  pinMode(kotl, OUTPUT);
 +
  pinMode(rubick, OUTPUT);
 +
  }
 +
  // the loop routine runs over and over again forever:
 +
  void loop() {
 +
  digitalWrite(tomato, HIGH);  // turn the LED on (HIGH is the voltage level)
 +
  delay(200);              // wait for a second
 +
  digitalWrite(tomato, LOW);    // turn the LED off by making the voltage LOW
 +
  delay(200);              // wait for a second
 +
  digitalWrite(kotl, HIGH);  // turn the LED on (HIGH is the voltage level)
 +
  delay(200);              // wait for a second
 +
  digitalWrite(kotl, LOW);    // turn the LED off by making the voltage LOW
 +
  delay(200);              // wait for a second
 +
  digitalWrite(rubick, HIGH);  // turn the LED on (HIGH is the voltage level)
 +
  delay(5000);              // wait for a second
 +
  digitalWrite(rubick, LOW);    // turn the LED off by making the voltage LOW
 +
  delay(200); 
 +
  digitalWrite(kotl, HIGH);  // turn the LED on (HIGH is the voltage level)
 +
  delay(200);              // wait for a second
 +
  digitalWrite(kotl, LOW);    // turn the LED off by making the voltage LOW
 +
  delay(200);              // wait for a second
 +
  }

Revision as of 14:45, 25 October 2013

Valdi áfangan vegna þess að ég hef áhuga á forritun, tölvutækni og tölvuleikjum.

Hef áhuga fyrir því að prófa allt sem er hérna og sjá hvort ég sé með einhvern áhuga á því. Ég hallast samt að því að læra forritun eða kerfisfræði seinna.

/*

 Blink
 Turns on an LED on for one second, then off for one second, repeatedly.

 This example code is in the public domain.
 */
 // Pin 13 has an LED connected on most Arduino boards.
 // give it a name:
 int tomato = 12;
 int kotl = 11;
 int rubick = 10;
 // the setup routine runs once when you press reset:
 void setup() {                
 // initialize the digital pin as an output.
 pinMode(tomato, OUTPUT);
 pinMode(kotl, OUTPUT);
 pinMode(rubick, OUTPUT);
 }
 // the loop routine runs over and over again forever:
 void loop() {
 digitalWrite(tomato, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(200);               // wait for a second
 digitalWrite(tomato, LOW);    // turn the LED off by making the voltage LOW
 delay(200);               // wait for a second
 digitalWrite(kotl, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(200);               // wait for a second
 digitalWrite(kotl, LOW);    // turn the LED off by making the voltage LOW
 delay(200);               // wait for a second
 digitalWrite(rubick, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(5000);               // wait for a second
 digitalWrite(rubick, LOW);    // turn the LED off by making the voltage LOW
 delay(200);  
 digitalWrite(kotl, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(200);               // wait for a second
 digitalWrite(kotl, LOW);    // turn the LED off by making the voltage LOW
 delay(200);               // wait for a second
 }