This repository has been archived by the owner on Jun 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
85 lines (65 loc) · 2.87 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Presentation.Shapes;
using Microsoft.SPOT.Touch;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace PR
{
public partial class Program
{
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
Debug.Print("Program Started");
//Attribution des différents numéros de ports
// numéros de ports à corriger
var ports = new ConfigurationPorts
{
idBaseRoulante = 8, // pin Kangaroo
idIO = 5, // le groupe IO (extendeur) est relié au pin 5 de la spider. le groupe IR & le jack sont branchés sur l'extendeur IO
idJack = 8, // pin 8 de l'extendeur
idInfrarougeAVG = 4, // id infra-rouge de l'extendeur. AVG = avant-gauche vu de l'arrière du robot
idInfrarougeAVD = 5, // idem
idInfrarougeARG = 6, // idem
idInfrarougeARD = 7, // idem
// idCapteurUltrason = 6, // pin 6 de la spider // RIP
idContAX12 = 11, // pin AX12
// idContAX12Jaune = 9, // pin AX12
};
ports.poussoir.idAX12PoussoirBleu = 2;
ports.poussoir.idAX12PoussoirJaune = 6;
ports.pince.idAX12PinceBleue = 1;
ports.pince.idAX12PinceJaune = 5;
ports.petitBras.idAX12CoudeBleu = 3;
ports.petitBras.idAX12RotateurBleu = 4; // ATTENTION : il faudra mettre le numéro 4 avec le logiciel !
ports.petitBras.idAX12CoudeJaune = 7;
ports.petitBras.idAX12RotateurJaune = 8;
// ces ports là sont des ports de la spyder/spider
ports.petitBras.idCapteurBrasBleu = 4;
ports.petitBras.idCapteurBrasJaune = 6; // ce port 4 n'est pas adapté, il faut en trouver un autre !!
// initialisation de l'IHM de sélection
IHM ihm_principal;
ihm_principal = new IHM();
ihm_principal.Selection();
PetitRobot robot;
robot = new PetitRobot(ports, ihm_principal.getEquipe(), ihm_principal.getDisposition(), ihm_principal);
Debug.Print("Godot viendra-t-il ?");
robot.AttendreJack();
// démarre le robot
Debug.Print("jack");
robot.Demarrer(90d);
Debug.Print("fin");
// l'action suivante n'est-elle pas prise en charge dans PetitRobot ?
//robot.Demarrer();
//Debug.Print("robot démarré");
}
}
}