sábado, 15 de abril de 2017

Convertir impresora en Slider para camara reto a Espacio de Cesar




El codigo de arduino es

#include <Stepper.h>

Stepper stepper(100, 8, 9, 10, 11);
int boton;
void setup()
{
  pinMode(12,INPUT);
}
void loop()
{
    boton = digitalRead(12);

  // check if the pushbutton is pressed.
  if (boton == HIGH)
  {  
  int sensorReading = analogRead(A0);
  for (int i=0; i<80; i++)
    {    
    digitalWrite(8, HIGH);
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    delay(sensorReading/8 +4 );
    digitalWrite(8, LOW);
    digitalWrite(9, HIGH);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    delay(sensorReading/8 +4 );
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);
    delay(sensorReading/8 +4 );
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(11, HIGH);
    delay(sensorReading/8 +4 );
    }
    delay(1000);
  for (int i=0; i<80; i++)
    {

    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(11, HIGH);
    delay(4 );
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);
    delay(4 );
    digitalWrite(8, LOW);
    digitalWrite(9, HIGH);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    delay(4);
    digitalWrite(8, HIGH);
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    delay(4);
    }
  }
  else {
 delay(100);
  }
}

lunes, 3 de abril de 2017

Como utilizar la protoboard

LISTA MATERIALES:

* 1 protoboard
*1 porta pilas
*4 pilas AA
* Caimanes
*1 microboton
*1 LED 5mm
*R1 1 kilo ohm

DIAGRAMA: