Skip to content
Extraits de code Groupes Projets
Valider c96c5281 rédigé par Diego de Fauconval's avatar Diego de Fauconval
Parcourir les fichiers

spi

parent fa4c74fd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#include <stdlib.h>
#include <stdio.h>
#include <wiringPi.h>
#include <wiringPiSPI.h>
#include <iostream>
using namespace std;
const int CHANNEL_CAN = 1;
int main(int argc, char const *argv[])
{
int result, fd;
unsigned char buff[30];
fd = wiringPiSPISetup(CHANNEL_CAN, 500000);
if (fd == -1) {
printf("Error setup\n");
exit(EXIT_FAILURE);
}
buff[0] = 0x40;
buff[1] = 0x01;
result = wiringPiSPIDataRW(CHANNEL_CAN, buff, 2);
return 0;
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter