« SE3 PSE Binome2023-6 » : différence entre les versions
		
		
		
		
		
		Aller à la navigation
		Aller à la recherche
		
				
		



		
	
| Ligne 6 : | Ligne 6 : | ||
| |- | |- | ||
| |- | |- | ||
| [[Fichier:Schematic2 manette.png|400px|description | [[Fichier:Schematic2 manette.png|400px|description]] | ||
| [[Fichier:Schematic1 manette.png|400px|desu]] | [[Fichier:Schematic1 manette.png|400px|desu<br>]] | ||
| [[Fichier:SCHEMATIC MANETTE.pdf|400px|PDF du schématique complet de la manette|gauche]] | [[Fichier:SCHEMATIC MANETTE.pdf|400px|PDF du schématique complet de la manette|gauche]] | ||
| [[Fichier:Video joystick manette.mp4|400px|néant<br>]] | [[Fichier:Video joystick manette.mp4|400px|néant<br>]] | ||
Version du 4 juin 2024 à 14:22
Conception de la manette
SCHÉMATIQUE KiCAD


PCB

Code C
Pour pouvoir avoir nos boutons fonctionnel on s'est basé sur la démo du joystick pour créer "Manette", et ensuite on est partie d'un code minimal pour pouvoir rajouté la description de notre manette, et créer deux interfaces, une pour nos boutons, et une autre pour nos LEDs.
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;
}
	/* Hardware Initialization */
	Joystick_Init();
	LEDs_Init();
	Buttons_Init();
	USB_Init();
	MCUCR |= (1<<JTD);
	MCUCR |= (1<<JTD);
	CLKSEL0 = 0b00010101;   // sélection de l'horloge externe
	CLKSEL1 = 0b00001111;   // minimum de 8Mhz
	CLKPR = 0b10000000;     // modification du diviseur d'horloge (CLKPCE=1)
	CLKPR = 0;              // 0 pour pas de diviseur (diviseur de 1)
	//Boutons A et B
	DDRF  &= 0b00111111;
	PORTF |= 0b11000000;
	
	//Boutons directionnels 
	DDRD  &= 0b11010001;
	PORTD |= 0b00101110;
	// Allumer les leds
	PORTF |= 0b00100011;
	PORTE |= 0b01000000;
Montage de la carte :
Fichiers: Fichier:ManetteUSBLilianPierre.zip
gerber: Fichiers: Fichier:SE3-pad-job.gbrjob.zip gerber: Fichiers: Fichier:SE3-pad-LGPC.zip





