bibliothèques / librairies utilisées :

matériel / hardware :

some arduino code snippet


typedef struct _frame_ {
  byte data[3];
  byte checksum
} Frame;

Frame f;

void foobar(_frame_* frame) {};  

useful C code snippet


#define BUFFER_SIZE 10
char buffer[BUFFER_SIZE];
int index=0;

buffer[index] = random();
++index%BUFFER_SIZE;

  • calcul de puissance avec des entiers : x^y

int pow(int x, int y) {
  return round(pow((double)x, (double)y));
}

  • conversion de MSB (Most Significant Byte) et LSB (Less Significant Byte)

x = ((unsigned int) buffer[0] <<8) | buffer[1]; 

Boutiques de composants électroniques sur Paris