Arduino: Razlika med redakcijama

Izbrisana vsebina Dodana vsebina
izbrisane so RSO rešitve za test na Vegovi
Vrstica 5:
 
Mikrokrmilnik so razvili na šoli oblikovanja v italijanskem mestu [[Ivrea]] in predstavlja enega zgodnjih mejnikov v gibanju odprtokodne strojne opreme.<ref>{{navedi novice| url=http://online.wsj.com/news/articles/SB10001424052748703499404574559960271468066 |title=Taking an Open-Source Approach to Hardware |date=27.11.2009 |last=Lahart |first=Justin |work=The Wall Street Journal |accessdate=27.10.2013}}</ref>
 
 
const int s1 = 8;
 
const int s2 = 6;
 
const int led = 7;
 
int stanje_led = 0;
 
int s1s = 0;
 
int s2s = 0;
 
// the setup function runs once when you press reset or power the board
 
void setup() {
 
  pinMode(s1, INPUT_PULLUP);
 
  pinMode(s2, INPUT_PULLUP);
 
  pinMode(led, OUTPUT);
 
}
 
// the loop function runs over and over again forever
 
void loop() {
 
  s1s = digitalRead(s1);
 
  s2s = digitalRead(s2);
 
  if (stanje_led == 0 && s1s == 1) {
 
    digitalWrite(led, HIGH);
 
  } else if (stanje_led == 1 && s2s == 1) {
 
    digitalWrite(led, LOW);  
 
  }
 
}
 
== Sklici in opombe ==