User:Zalán Szakács/grad prototyping: Difference between revisions

From XPUB & Lens-Based wiki
Line 41: Line 41:
   digitalWrite(ledPin, LOW);
   digitalWrite(ledPin, LOW);
   delay(1000);
   delay(1000);
}
</pre>
'''2. Arduino Script'''
<br>
<pre>
int LED = 12;
int BUTTON = 4;
void setup()
{
  pinMode(LED,OUTPUT);
  pinMode(BUTTON,INPUT);
}
void loop()
{
  if(digitalRead(BUTTON) == HIGH)
  {
  digitalWrite(LED,HIGH);
  }else
  {
  digitalWrite(LED,LOW);
  }
}
}



Revision as of 11:42, 2 October 2018


P R O T O T Y P I N G

What is a Circuit?


What are Resistors?


conversion calculator resistor color code

How to use Arduino?

1. Arduino Script


*
 * Zalan's first Program
 */

 int ledPin = 13;
 void setup()
 { 
  //initialize pins as outputs
  pinMode(ledPin, OUTPUT);
 }
void loop()
{ 
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
}

2. Arduino Script

int LED = 12;
int BUTTON = 4;


void setup()
{
  pinMode(LED,OUTPUT);
  pinMode(BUTTON,INPUT);
}

void loop()
{
  if(digitalRead(BUTTON) == HIGH)
  {
  digitalWrite(LED,HIGH);
  }else
  {
  digitalWrite(LED,LOW);
  }
}

Light-Emitting Diodes (LEDs)