end first day

This commit is contained in:
quentin.perret 2022-05-30 18:01:28 +02:00
parent ad4c24a9e2
commit ed38934146
15 changed files with 2100085 additions and 900024 deletions

View file

@ -2,6 +2,7 @@
"C_Cpp.errorSquiggles": "Disabled",
"files.associations": {
"time.h": "c",
"b2hd.h": "c"
"b2hd.h": "c",
"main.h": "c"
}
}

View file

@ -1,9 +1,11 @@
CC = gcc
TARGET = data
all: b2hd.c getArray.c
all: b2hd.c getArray.c power.c newFileData.c
$(CC) b2hd.c -o b2hd
$(CC) getArray.c -o getArray
$(CC) power.c -o power
$(CC) newFileData.c -o newFileData
clean:
rm *.o

Binary file not shown.

View file

@ -1,4 +1,5 @@
#include "b2hd.h"
#include "main.h"
int b2hd ()
{
int i;

Binary file not shown.

View file

@ -1,8 +1,8 @@
#include "b2hd.h"
#include "main.h"
int getArray(int nRow){
int getArray(){
int nCol = 8; // imposé par le nombre de sortie du capteur Vegetal Signal
int nCol = 9; // imposé par le nombre de sortie du capteur Vegetal Signal
int tab[nRow][nCol]; // création de la matrice contenant les valeurs , nRow définit dans les paramètre de la fonction
char buffer[200]; //200 valeur arbitraire
@ -11,19 +11,35 @@ int getArray(int nRow){
for(int i = 0 ; i < nRow ; i++){
if (!fgets(buffer, sizeof buffer, stdin)) break; // condition d'arret de la boucle si fichier fini
printf(buffer);
//printf(buffer);
token = strtok(buffer, ","); // séparation valeur par virgule initiale : csv
tab[i][0] = atoi(token);
for(int j = 0 ; j < 8 ; j++){
for(int j = 1 ; j < nCol ; j++){
token = strtok(NULL, ",");
if(token == NULL) break;
tab[i][j] = atoi(token); //transtypage char to int
fprintf(stdout,token);
}
//printf("%d\n" , tab[i][0]);
}
}
void newFile(){
char buffer[256];
for(int i = 0; i < nRow; i++){
fgets(buffer , sizeof buffer , stdin);
printf("Line : %s\n" , buffer);
}
while(1){
if(!fgets(buffer,sizeof buffer , stdin)) break;
fprintf(stdin,"%s\n",buffer);
}
for(int i = 0; i < nRow; i++){
fprintf(stdin,"\n");
}
}
int main(int argc , char** argv){
int nRow = 3000; //valeur arbitraire
getArray(nRow);
getArray();
newFile();
}

View file

@ -3,15 +3,19 @@
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
typedef struct {
uint8_t octet1;
uint8_t octet2;
uint8_t octet3;
uint8_t octet4;
} quartet;
int64_t millis()
{
struct timespec now;
timespec_get(&now, TIME_UTC);
return ((int64_t) now.tv_sec) * 1000 + ((int64_t) now.tv_nsec) / 1000000;
}
int nRow = 100000;

BIN
C-Script/newFileData Executable file

Binary file not shown.

18
C-Script/newFileData.c Normal file
View file

@ -0,0 +1,18 @@
#include "main.h"
void newFile(){
char buffer[256];
for(int i = 0; i < nRow; i++){
fgets(buffer , sizeof buffer , stdin);
}
while(1){
if(!fgets(buffer,sizeof buffer , stdin)) break;
fprintf(stdin,"%s\n",buffer);
}
for(int i = 0; i < nRow; i++){
fprintf(stdin,"\n");
}
}
int main(int argc , char** argv){
newFile();
}

BIN
C-Script/power Executable file

Binary file not shown.

9
C-Script/power.c Normal file
View file

@ -0,0 +1,9 @@
#include "main.h"
float power(){
}
int main(int argc , char** argv){
power();
}

900011
C-Script/save.txt Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

0
C-Script/test1.txt Normal file
View file

File diff suppressed because it is too large Load diff