9
ARDUINO WORKSHOP Special Event for Fans

181201 Tootuba Arduino workshop - Digipurk · 2018. 12. 1. · •Arduino is an open-source electronics platform based on easy-to-use hardware and software. • Read input: light

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

  • ARDUINO WORKSHOP

    Special Event for Fans

  • Ringa Rooteman Ülari Ainjärv

    Programmer

    IT architect

    Programmer

    Teacher of Robotics and Hobby Club

  • • Arduino is an open-source electronics platform based on easy-to-use hardware and software.

    • Read input: light on a sensor, a finger on a button.• Give output: activating a motor, turning on an LED.• Software is easy-to-use.

    ARDUINO UNO

  • ARDUINO UNO

  • LED AND BUTTON

  • int switchState = 0;
void setup() {
 pinMode(12,OUTPUT);
 pinMode(13,OUTPUT); 
 pinMode(2,INPUT);
}
void loop() {
 switchState = digitalRead(2);
 if (switchState == LOW) {
 digitalWrite(12, LOW);
 digitalWrite(13, LOW);
 } else {
 digitalWrite(12, HIGH);
 digitalWrite(13, HIGH);
 delay(250);
 digitalWrite(12, LOW);
 digitalWrite(13, LOW);
 delay(250);
 }
}

    LED AND BUTTON

  • RGB LED

  • const int greenLEDPin = 4;const int redLEDPin = 2;const int blueLEDPin = 7;

    int redValue = 0; int greenValue = 0;int blueValue = 0;

    void setup() {pinMode(greenLEDPin, OUTPUT);pinMode(redLEDPin, OUTPUT);pinMode(blueLEDPin, OUTPUT);

    }void loop() {

    redValue = 255;greenValue = 0;blueValue = 0;analogWrite(redLEDPin, redValue);analogWrite(greenLEDPin, greenValue);analogWrite(blueLEDPin, blueValue);

    }

    RGB LED

  • INFO

    Ringa Rooteman tel: 52 55 834

    email: [email protected]

    Ülari Ainjärv tel: 50 10 478

    email: [email protected]

    Arduino arduino.cc

    Workshop material robootika.digipurk.ee/arduino-workshop