Légères adatpations du pilotage (inversion axes + correction bug pot)
This commit is contained in:
		
							parent
							
								
									73a667d505
								
							
						
					
					
						commit
						0078762f8f
					
				
							
								
								
									
										20
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								main.c
									
									
									
									
									
								
							@ -15,7 +15,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define PINCE_OUVERTE 0
 | 
					#define PINCE_OUVERTE 0
 | 
				
			||||||
#define PINCE_PLANTE 1
 | 
					#define PINCE_PLANTE 1
 | 
				
			||||||
#define PINCE_POT 1
 | 
					#define PINCE_POT 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ASCENSEUR_BAS 0
 | 
					#define ASCENSEUR_BAS 0
 | 
				
			||||||
#define ASCENSEUR_HAUT 1
 | 
					#define ASCENSEUR_HAUT 1
 | 
				
			||||||
@ -152,8 +152,8 @@ void main()
 | 
				
			|||||||
		// Voie Y
 | 
							// Voie Y
 | 
				
			||||||
		result0 = AdcRead0()/16;
 | 
							result0 = AdcRead0()/16;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		message[0] = 255 - result0;
 | 
							message[0] = result0;
 | 
				
			||||||
		message[1] = result1;
 | 
							message[1] = 255 - result1;
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		//clic sur le joystic
 | 
							//clic sur le joystic
 | 
				
			||||||
		gpio_init(1);
 | 
							gpio_init(1);
 | 
				
			||||||
@ -163,9 +163,9 @@ void main()
 | 
				
			|||||||
		if (!joystic_clicker)
 | 
							if (!joystic_clicker)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			if(result1 > 135){
 | 
								if(result1 > 135){
 | 
				
			||||||
				message[2] = 220;
 | 
					 | 
				
			||||||
			}else if (result1 < 122){
 | 
					 | 
				
			||||||
				message[2] = 30;
 | 
									message[2] = 30;
 | 
				
			||||||
 | 
								}else if (result1 < 122){
 | 
				
			||||||
 | 
									message[2] = 220;
 | 
				
			||||||
			}else{
 | 
								}else{
 | 
				
			||||||
				message[2] = 128;
 | 
									message[2] = 128;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@ -181,7 +181,7 @@ void main()
 | 
				
			|||||||
		// Bouton plante
 | 
							// Bouton plante
 | 
				
			||||||
		if(bouton_appui(6)){
 | 
							if(bouton_appui(6)){
 | 
				
			||||||
			if(pince == PINCE_OUVERTE){
 | 
								if(pince == PINCE_OUVERTE){
 | 
				
			||||||
				pince = PINCE_PLANTE;
 | 
									pince = PINCE_POT;
 | 
				
			||||||
			}else{
 | 
								}else{
 | 
				
			||||||
				pince = PINCE_OUVERTE;
 | 
									pince = PINCE_OUVERTE;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@ -189,7 +189,7 @@ void main()
 | 
				
			|||||||
		// Bouton Pot
 | 
							// Bouton Pot
 | 
				
			||||||
		if(bouton_appui(10)){
 | 
							if(bouton_appui(10)){
 | 
				
			||||||
			if(pince == PINCE_OUVERTE){
 | 
								if(pince == PINCE_OUVERTE){
 | 
				
			||||||
				pince = PINCE_POT;
 | 
									pince = PINCE_PLANTE;
 | 
				
			||||||
			}else{
 | 
								}else{
 | 
				
			||||||
				pince = PINCE_OUVERTE;
 | 
									pince = PINCE_OUVERTE;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@ -198,10 +198,10 @@ void main()
 | 
				
			|||||||
		// Ascenseur
 | 
							// Ascenseur
 | 
				
			||||||
		// Commande simple
 | 
							// Commande simple
 | 
				
			||||||
		if(bouton_appui(2)){
 | 
							if(bouton_appui(2)){
 | 
				
			||||||
			if(ascenceur == ASCENSEUR_BAS){
 | 
								if(ascenceur == ASCENSEUR_HAUT){
 | 
				
			||||||
				ascenceur = ASCENSEUR_HAUT;
 | 
					 | 
				
			||||||
			}else{
 | 
					 | 
				
			||||||
				ascenceur = ASCENSEUR_BAS;
 | 
									ascenceur = ASCENSEUR_BAS;
 | 
				
			||||||
 | 
								}else{
 | 
				
			||||||
 | 
									ascenceur = ASCENSEUR_HAUT;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
		// Commande évoluée
 | 
							// Commande évoluée
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user