« SE3 PSE Binome2023-6 » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 17 : | Ligne 17 : | ||
== Code C == | |||
<syntaxhighlight lang="c"> | |||
bool GetNextReport(USB_JoystickReport_Data_t* const ReportData) | |||
{ | |||
bool InputChanged = false; | |||
/* Clear the report contents */ | |||
memset(ReportData, 0, sizeof(USB_JoystickReport_Data_t)); | |||
if (~(PINF>>PIN7) & 1) ReportData->Button |= (1 << 1); | |||
if (~(PINF>>PIN6) & 1) ReportData->Button |= (1 << 0); | |||
if (~(PIND>>PIN1) & 1) ReportData->Y = 100; | |||
if (~(PIND>>PIN2) & 1) ReportData->X = 100; | |||
if (~(PIND>>PIN3) & 1) ReportData->X = -100; | |||
if (~(PIND>>PIN5) & 1) ReportData->Y = -100; | |||
InputChanged = 1; | |||
return InputChanged; | |||
} | |||
</syntaxhighlight> | |||
Version du 22 mai 2024 à 10:05
Conception de la manette
Code C
bool GetNextReport(USB_JoystickReport_Data_t* const ReportData)
{
bool InputChanged = false;
/* Clear the report contents */
memset(ReportData, 0, sizeof(USB_JoystickReport_Data_t));
if (~(PINF>>PIN7) & 1) ReportData->Button |= (1 << 1);
if (~(PINF>>PIN6) & 1) ReportData->Button |= (1 << 0);
if (~(PIND>>PIN1) & 1) ReportData->Y = 100;
if (~(PIND>>PIN2) & 1) ReportData->X = 100;
if (~(PIND>>PIN3) & 1) ReportData->X = -100;
if (~(PIND>>PIN5) & 1) ReportData->Y = -100;
InputChanged = 1;
return InputChanged;
}
Montage de la carte :
Fichiers: Fichier:ManetteUSBLilianPierre.zip
gerber: Fichiers: Fichier:SE3-pad-job.gbrjob.zip gerber: Fichiers: Fichier:SE3-pad-LGPC.zip