miércoles, 25 de marzo de 2015

Robotic gripper code

Code by Julia K. Mars for the robotic gripper:

#include <Servo.h>
#define PIN_TRIG 12
#define PIN_ECO 13

Servo servo;
Servo s1;
void setup() {

servo.attach(8);
s1.attach(9);
// Inicializacion de la comunicación serial
Serial.begin (9600);
//  Inicializar los pines digitales
pinMode(PIN_TRIG, OUTPUT);
pinMode(PIN_ECO, INPUT);
}

void loop() {
  int potvalue = analogRead(A0); // Lectura del potenciómetro
  map(potvalue, 0, 1023, 0, 180); // Cambiamos el valor del pot (por ser analógico de 0 a 1023) a una escala concreta (la del servo).
  s1.write(potvalue); // movemos el servo con el valor que dé el potenciómetro
long duracion, distancia;  // variables para duración y distancia del disparo

/* Hacer el disparo */
digitalWrite(PIN_TRIG, LOW);
delayMicroseconds(2);
digitalWrite(PIN_TRIG, HIGH);
delayMicroseconds(10);
digitalWrite(PIN_TRIG, LOW);
/* Recibe el eco de respuesta */
duracion = pulseIn(PIN_ECO, HIGH);

/* Cálculo de la distancia */
distancia = (duracion/2) / 29;

Serial.print(distancia);
Serial.println();
/* Imprimir resultados al monitor serial*/
if (distancia <= 5){
servo.write(20);

}

else {
servo.write(180);

}



}

martes, 24 de marzo de 2015

MUSIC LICENSE

Hi dear followers!
I think I have to give a clear information about the license of my music, so there we go!
EVERY SONG OF MINE (an ORIGINAL song by Julia K. Mars) has the following license:

Creative Commons License
Original songs by Julia K. Mars are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

If you want more information about this type of Creative Commons License check out this page:

http://creativecommons.org/licenses/by-nc-sa/4.0/


Thank you for reading. Bye!