User:Arnar Sveinn: Difference between revisions
Jump to navigation
Jump to search
m Creating user page for new user. |
Arnar Sveinn (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
Please tell us little bit about yourself (minimum 15 words). | Please tell us little bit about yourself (minimum 15 words). | ||
== '''Arduino''' == | |||
Umferðaljós. | |||
int red = 13; | |||
int yellow = 12; | |||
int green = 11; | |||
// the setup routine runs once when you press reset: | |||
void setup() { | |||
// initialize the digital pin as an output. | |||
pinMode(red,OUTPUT); | |||
pinMode(yellow,OUTPUT); | |||
pinMode(green,OUTPUT); | |||
} | |||
// the loop routine runs over and over again forever: | |||
void loop(){ | |||
digitalWrite(red, HIGH); | |||
delay(1000); | |||
digitalWrite(red, LOW); | |||
delay(100); | |||
digitalWrite(yellow,HIGH); | |||
delay(1000); | |||
digitalWrite(yellow,LOW); | |||
delay(100); | |||
digitalWrite(green,HIGH); | |||
delay(1000); | |||
digitalWrite(green,LOW); | |||
delay(100); | |||
} |
Revision as of 16:17, 28 October 2013
Er að byrja í fablab og hef aldrei profað þetta áður, langaði að prófa eitthvað nýtt. Hef áhuga á t.d íþóttum og tónlist. Er einnig í tölvufræði þar sem ég er að læra að forrita og vill sjá hvort að það nýtist mér í þessum áfanga.
Please tell us little bit about yourself (minimum 15 words).
Arduino
Umferðaljós. int red = 13; int yellow = 12; int green = 11; // the setup routine runs once when you press reset: void setup() {
// initialize the digital pin as an output.
pinMode(red,OUTPUT); pinMode(yellow,OUTPUT); pinMode(green,OUTPUT); }
// the loop routine runs over and over again forever: void loop(){
digitalWrite(red, HIGH); delay(1000); digitalWrite(red, LOW); delay(100); digitalWrite(yellow,HIGH); delay(1000); digitalWrite(yellow,LOW); delay(100); digitalWrite(green,HIGH); delay(1000); digitalWrite(green,LOW); delay(100);
}