Social Icons

Mostrando postagens com marcador Jeremy Blum. Mostrar todas as postagens
Mostrando postagens com marcador Jeremy Blum. Mostrar todas as postagens

Jeremy Blum Projects - Arduino Parte [10]

Este é da semana 10, trataremos sobre Interfaces SPI, Debouncing, Interruptores
Para quem não viu os outros(Recomendo seguir a Ordem):
Semana [1]
Semana [2]
Semana [3]
Semana [4]
Semana [5]
Semana [6]

Semana [7]
Semana [8]
Semana [9]
---------------------------------------------
----------------------------------------------



GNU GPL LicenseDistribuido apartir de GNU General Public (Open-Source) License.
Por Favor Compartilhe como "quiser".

Jeremy Blum Projects - Arduino Parte [9]

Este é da semana 9, trataremos sobre Interfaces SPI, xBee, Wi-fi, Wireless, 
Para quem não viu os outros(Recomendo seguir a Ordem):
Semana [1]
Semana [2]
Semana [3]
Semana [4]
Semana [5]
Semana [6]

Semana [7]
Semana [8]
--------------------------
 - Códigos Usados
 - Peças Usadas
--------------------------



GNU GPL LicenseDistribuido apartir de GNU General Public (Open-Source) License.
Por Favor Compartilhe como "quiser".

Jeremy Blum Projects - Arduino Parte [8]

Este é da semana 8, trataremos sobre Interfaces SPI, LED's, 
Para quem não viu os outros:
Semana [1]
Semana [2]
Semana [3]
Semana [4]
Semana [5]
Semana [6]

Semana [7]


------------------------------------------------

  • Download Códigos Usados


  • Download Circuito

  • ------------------------------------------------

    Jeremy Blum Projects - Arduino Parte [7]

    Este é da semana 7, trataremos sobre Temperatura, Sensores,
    Para quem não viu os outros:
    Semana [1]
    Semana [2]
    Semana [3]
    Semana [4]
    Semana [5]
    Semana [6]
    --------------------------------------------------------
    Download Códigos Usados
    Download Esquemas (Circuitos)
    --------------------------------------------------------



    Jeremy Blum Projects - Arduino Parte [4]

    Esta semana é sobre todas as entradas analógicas para o Arduino. Jeremy irá te mostrar como você pode usar um circuito divisor de tensão (visto no episódio 3) e um resistor variável para fazer um sensor analógico. Também vamos usar um sensor infravermelho Sharp distância como uma entrada analógica para detectar a distância e movimento (com alguma programação inteligente). Até o final deste episódio, você será capaz de criar seu próprio sistema de iluminação de emergência! Sem mais delongas, confira esta semana tutorial sobre entradas analógicas para o arduino ...]




























    //Program by Jeremy Blum
    //www.jeremyblum.com
    //This will turn on an LED after a threshold
    int sensePin = 0;
    int ledPin = 9;
    void setup()
    {
      //Note: We don't need to specifiy sensePin as an
      //input, since it defaults to that when we read it

      //The LED pin needs to be set as an output
      pinMode(ledPin, OUTPUT);
      //This is the default value, but we can set it anyways
      analogReference(DEFAULT); //5V Reference on UNO
     
    }
    void loop()
    {
      // read the sensor
      int val = analogRead(sensePin);
     
      if(val < 800)
      {
        digitalWrite(ledPin, HIGH);
      }
      else
      {
        digitalWrite(ledPin, LOW);
      }
    }

    ---------------------------------------------


    //Program by Jeremy Blum
    //www.jeremyblum.com
    //This will turn on an LED after a threshold
    int sensePin = 0;
    int ledPin = 9;
    void setup()
    {
      //Note: We don't need to specifiy sensePin as an
      //input, since it defaults to that when we read it
      //The LED pin needs to be set as an output
      pinMode(ledPin, OUTPUT);
      //This is the default value, but we can set it anyways
      analogReference(DEFAULT); //5V Reference on UNO
     
    }
    void loop()
    {
      // read the sensor
      int val = analogRead(sensePin);
     
      if(val < 800)
      {
        digitalWrite(ledPin, HIGH);
      }
      else
      {
        digitalWrite(ledPin, LOW);
      }
    }

    ------------------------------------


    //Program by Jeremy Blum
    //www.jeremyblum.com
    //Turn on an LED if a room is dim, and motion is detected
    //Define Pins
    int motionPin = 0;
    int lightPin = 1;
    int ledPin = 9;
    //Distance Variables
    int lastDist = 0;
    int currentDist = 0;
    //Threshold for Movement
    int thresh = 200;
    void setup()
    {
      //The LED pin needs to be set as an output
      pinMode(ledPin, OUTPUT);
    }
    void loop()
    {
      // read the sensor
      int lightVal = analogRead(lightPin);
      currentDist = analogRead(motionPin);
      //Does the current distance deviate from the last distance by more than the threshold?
      if ((currentDist > lastDist + thresh || currentDist < lastDist - thresh) && lightVal < 800)
      {
        digitalWrite(ledPin, HIGH);
        delay(1000);
      }
      else
      {
        digitalWrite(ledPin, LOW);
      }
      lastDist = currentDist;
    }

    ---------------------------------------------


    //Program by Jeremy Blum
    //www.jeremyblum.com
    //Reads and analog sensor and displays the value
    int sensePin = 0;
    void setup()
    {
      //Note: We don't need to specifiy sensePin as an
      //input, since it defaults to that when we read it
      //This is the default value, but we can set it anyways
      analogReference(DEFAULT); //5V Reference on UNO
      //Allows us to listen to serial communications from the arduino
      Serial.begin(9600);
    }
    void loop()
    {
      // print the button state to a serial terminal
      Serial.println(analogRead(sensePin));
      delay(500);
      //wait half a second, then print again.
    }

    Jeremy Blum Projects - Arduino Parte [2]

    Você que ainda não viu á parte 1 clique aqui!

    Nesse Video trataremos sobre:

    --> Saídas PWM e I/O
    --> LED
    --> Protoboard
    --> Botões
    --> ON/OFF Sem Ruídos







    Código 1:

    /*
    Arduino Tutorials
    Episode 2
    Switch1 Program
    Written by: Jeremy Blum
    */
    int switchPin = 8;
    int ledPin = 13;
    void setup()
    {
      pinMode(switchPin, INPUT);
      pinMode(ledPin, OUTPUT);
    }
    void loop()
    {
      if (digitalRead(switchPin) == HIGH)
      {
        digitalWrite(ledPin, HIGH);
      }
      else
      {
        digitalWrite(ledPin, LOW);
      }
    }


    ----------------------------------------------------------------------
     Código 2

    /*
    Arduino Tutorials
    Episode 2
    Switch Program
    Written by: Jeremy Blum
    */
    int switchPin = 8;
    int ledPin = 13;
    boolean lastButton = LOW;
    boolean ledOn = false;
    void setup()
    {
      pinMode(switchPin, INPUT);
      pinMode(ledPin, OUTPUT);
    }
    void loop()
    {
      if (digitalRead(switchPin) == HIGH && lastButton == LOW)
      {
        ledOn = !ledOn;
        lastButton = HIGH;
      }
      else
      {
        //lastButton = LOW;
        lastButton = digitalRead(switchPin);
      }
     
      digitalWrite(ledPin, ledOn);
    }

    ----------------------------------------------------

    Código 3;

    /*
    Arduino Tutorials
    Episode 2
    Switch3 Program (debounced)
    Written by: Jeremy Blum
    */
    int switchPin = 8;
    int ledPin = 13;
    boolean lastButton = LOW;
    boolean currentButton = LOW;
    boolean ledOn = false;
    void setup()
    {
      pinMode(switchPin, INPUT);
      pinMode(ledPin, OUTPUT);
    }
    boolean debounce(boolean last)
    {
      boolean current = digitalRead(switchPin);
      if (last != current)
      {
        delay(5);
        current = digitalRead(switchPin);
      }
      return current;
    }
    void loop()
    {
      currentButton = debounce(lastButton);
      if (lastButton == LOW && currentButton == HIGH)
      {
        ledOn = !ledOn;
      }
      lastButton = currentButton;
      digitalWrite(ledPin, ledOn);
    }

    ----------------------------------------

    Código 4;

    /*
    Arduino Tutorials
    Episode 3
    Switch4 Program (pwm)
    Written by: Jeremy Blum
    */
    int switchPin = 8;
    int ledPin = 11;
    boolean lastButton = LOW;
    boolean currentButton = LOW;
    int ledLevel = 0;

    void setup()
    {
      pinMode(switchPin, INPUT);
      pinMode(ledPin, OUTPUT);
    }
    boolean debounce(boolean last)
    {
      boolean current = digitalRead(switchPin);
      if (last != current)
      {
        delay(5);
        current = digitalRead(switchPin);
      }
      return current;
    }
    void loop()
    {
      currentButton = debounce(lastButton);
      if (lastButton == LOW && currentButton == HIGH)
      {
        ledLevel = ledLevel + 51;
      }
      lastButton = currentButton;
      if (ledLevel > 255) ledLevel = 0;
      analogWrite(ledPin, ledLevel);
    }

    Jeremy Blum Projects - Arduino Parte [1]



    Achei esse cara pesquisando por ai ele cria VideoAulas toda semana sobre arduino e como criar coisas passo a passo muito simples e fácil.
    Já esta na semana 11 mas eu colocarei aqui pouco à pouco por falta de tempo.
    Para quem não entende inglês estarei explicando abaixo basicamente o que ele fez, mesmo sendo extremamente intuitivo o video não precisando necessariamente de tradução mas...

    Episódio 1
    Esse Episódio em específico trata sobre:

    --> Arduino
    --> LED
    --> C/C++
    --> Efeitos Pisca-Pisca (Blink no arduino.cc)

    Após o video todos os código que precisara e circuitos:





    /*
    Jeremy's First Program
    It's awesome!
    */

    int ledPin = 13;

    void setup()
    {
      //initialize pins as outputs
      pinMode(ledPin, OUTPUT);
    }

    void loop()
    {
      digitalWrite(ledPin, HIGH);
      delay(1000);
      digitalWrite(ledPin, LOW);
      delay(1000);
    }