Skip to content

Commit

Permalink
Archivos pasados del drive
Browse files Browse the repository at this point in the history
Primera vez que se pasan los archivos del drive a git.
  • Loading branch information
CarlaSobico authored May 11, 2018
1 parent c79af81 commit 50c3bca
Show file tree
Hide file tree
Showing 9 changed files with 652 additions and 0 deletions.
9 changes: 9 additions & 0 deletions DRONEsalida.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}
Binary file added Documentación.docx
Binary file not shown.
473 changes: 473 additions & 0 deletions Encoder-PPM -v3.c

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions Grupo 2/AnalogReadSerial.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@


/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Graphical representation is available using serial plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/

// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int pote_izq_y = analogRead(A0);
int pote_izq_x = analogRead(A1);
int pote_der_y = analogRead(A2);
int pote_der_x = analogRead(A3);

pote_izq_y = map(pote_izq_y, 0, 1023, 0, 255);
pote_izq_x = map(pote_izq_x, 0, 1023, 0, 255);
pote_der_y = map(pote_der_y, 0, 1023, 0, 255);
pote_der_x = map(pote_der_x, 0, 1023, 0, 255);

// print out the value you read:

Serial.print(pote_izq_y);
Serial.print("\t");
Serial.print(pote_izq_x);
Serial.print("\t");
Serial.print(pote_der_y);
Serial.print("\t");
Serial.println(pote_der_x);

delay(1); // delay in between reads for stability
}
Binary file added RF24-master.zip
Binary file not shown.
Binary file added _SPI_.docx
Binary file not shown.
111 changes: 111 additions & 0 deletions codigoControlSalida.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Graphical representation is available using serial plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
/*
int pushButton2 = 2;
int pushButton3 = 3;
int pushButton4 = 4;
*/
/* the setup routine runs once when you press reset:*/
#define MAX_DATOS 10

short int R1X;
short int R1Y;
short int R2X;
short int R2Y;
short int CH6;
short int TRAINER; /* los ultimos tres son char */
short int CH5;
short int ELEV;

char data[MAX_DATOS];



void setup() {
// initialize serial communication at 9600 bits per second:


Serial.begin(9600);


}

// the loop routine runs over and over again forever:
void loop() {
R1X =/* analogRead(A0);*/1;
R1Y =/* analogRead(A1);*/2;
R2X =/* analogRead(A3);*/3;
R2Y =/* analogRead(A2);*/4;
CH6 =/* analogRead (4);*/5;
TRAINER = /*digitalRead(2);*/6;
CH5 = /*digitalRead(3);*/7;
ELEV = /*digitalRead(4);*/8;

// read the input on analog pin 0:
data[0]='0';/*header*/
data[1]=(char*)R1X;
data[2]=(char*)R1Y;
data[3]= (char*)R2X;
data[4]= (char*)R2Y;
data[5]= (char*)CH6;
data[6]= (char*)TRAINER;
data[7]= (char*)CH5;
data[8]= (char*)ELEV;
data[9]=(char*)XORChecksum8(data,MAX_DATOS-1);

Serial.write(data[9]);
delay(1000);
}

uint8_t XORChecksum8(byte *data, size_t dataLength)
{

uint8_t value = 0;
for (size_t i = 1; i+1 < dataLength ; i++)
{
value ^= (uint8_t)data[i];
Serial.print(value);
}
return value;
}



/*void itoc(
{
int a=1;
char b[2];
String str;
str=String(a);
str.toCharArray(b,2);
}*/

/* // print out the value you read:
Serial.print(R1X);
Serial.print('\t');
Serial.print(R1Y);
Serial.print('\t');
Serial.print(R2X);
Serial.print('\t');
Serial.print(R2Y);
Serial.print('\t');
Serial.print(CH6);
Serial.print('\t');
Serial.print(TRAINER);
Serial.print('\t');
Serial.print(CH5);
Serial.print('\t');
Serial.print(ELEV);
Serial.print('\n');
delay(1); // delay in between reads for stability
}*/
17 changes: 17 additions & 0 deletions codigorobado.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
int numero = 1570;
byte imprimir;
void setup(){
Serial.begin(115200);
}

void loop() {
imprimir=highByte(numero);
/*Me quedo con el bloque mas significativo en bytes*/
Serial.print(imprimir);
/*Me quedo con el bloque menos significativo en bytes*/
imprimir=lowByte(numero);
Serial.print(imprimir);
delay(1000);
Serial.println();

}
Binary file not shown.

0 comments on commit 50c3bca

Please sign in to comment.