jueves, 22 de septiembre de 2011

ExPeRiMeNtS

In this lynks u can find sensors,, etc. for ur projects

SpArKFuN

LyNkSMoTiOn

MiCrOcHiP

Remeember de 2nd one when u type lynx www.google.com when GnOmE is not working xDD

Sit players and type sudo apt-get install -y crossover "minus yes"

Go Go Go!

jueves, 30 de junio de 2011

miércoles, 30 de marzo de 2011

=:Dev C++:= "WoRkInGwItHfIlEs"

This program do this: Copy the seccond column from one file like this, its file name is peso.txt

0.000000 0.243800 24/03/2011 10:30:00 a.m.
1.000000 0.243800 24/03/2011 10:30:02 a.m.
2.000000 0.243700 24/03/2011 10:30:03 a.m.
3.000000 0.243500 24/03/2011 10:30:04 a.m.
4.000000 0.243300 24/03/2011 10:30:05 a.m.
5.000000 0.243100 24/03/2011 10:30:06 a.m.
6.000000 0.243100 24/03/2011 10:30:07 a.m.
7.000000 0.243200 24/03/2011 10:30:08 a.m.
8.000000 0.243400 24/03/2011 10:30:09 a.m.
9.000000 0.243400 24/03/2011 10:30:10 a.m.



I'll take out the other columns to use only one column for use in matlab (this looks like a homework jeje) RemoveDate.c


#include {stdio.h} //change "{" for "less than <"
#include {conio.h} //change "}" for "greater than >"
void main ()
{
FILE *balanza ;
FILE *matlab ;
char c ;
int i = 0, s = -1 ;
printf("\tCentro de Ciencias Aplicadas al Desarrollo Tecnologico CCADET\n\n") ;
printf("\n\t\tBALANZA'S FILE MUST BE NAMED: peso.txt\n\n") ;
printf("\t\tTHE OUTPUT FILE IS matlab.m\n\n") ;
system("PAUSE") ;
balanza = fopen ("g:/peso.txt","r") ; //select the input file dir
matlab = fopen("g:/matlab.m","w") ; //select the output file dir
fprintf(matlab,"b=[") ;
while (c != EOF)
{
if(c == '\n')
{
i=0;
s++;
fprintf(matlab,"\n") ;
}
if(c == ' ')
{
i++;
if(i==5)
{
printf("\n\n\t") ;
}
}
c=getc(balanza) ;
if(i>3&&i<5)
{
fprintf(matlab,"%c",c) ;
printf("%c",c) ;
}
}
fprintf(matlab,"\b] ;\n") ;
fprintf(matlab,"t=[0:1:%d] ;\n",s) ;
fprintf(matlab,"plot(t,b) ;\n") ;
fprintf(matlab,"xlabel('Tiempo [s]')\n") ;
fprintf(matlab,"ylabel('Peso [g]')\n") ;
fprintf(matlab,"legend('peso de la muestra [g]') ;") ;
fclose(matlab) ;
fclose(balanza) ;
printf("\t\t\tSIZE OF TIME: %d\n\n",s) ;
printf("\t\tDATE AND TIME HAS BEEN REMOVED FROM *peso.txt*\n\n") ;
system("PAUSE") ;
}


Open the output file matlab.m and see your graph (press F5)


b=[0.243800
0.243800
0.243700
0.243500
0.243300
0.243100
0.243100
0.243200
0.243400
0.243400
. . .. . .
. . . ..] ;
t=[0:1:32767] ;
plot(t,b) ;
xlabel('Tiempo [s]')
ylabel('Peso [g]')
legend('PESO DE LA MUESTRA') ;