void serialEvent(){ while (Serial.available()) { // get the new byte: char inChar = (char)Serial.read(); // add it to the inputString: inputString += inChar; // if the incoming character is a newline, set a flag // so the main loop can do something about it: if (inChar == '\n') { stringComplete = true; } //la première boucle while s’arrête quand Serial.available() est false, donc ça ne peut pas venir dans la seconde. //de toute façon ce n’est pas comme ça qu’il faut faire while (Serial.available()) { // get the new byte: char inChar1 = (char)Serial.read(); // add it to the inputString: inputString1 += inChar1; // if the incoming character is a newline, set a flag // so the main loop can do something about it: if (inChar1 == '\n') { stringComplete1 = true; } }
char(10)ou
‘\n’en arduino
"123;213;79\n"et côté arduino tu découpes cette string pour reconstituer tes 3 valeurs.
Dim rouge As Integer = 123 Dim vert As Integer = 213 Dim bleu As Integer = 79 Dim tab As Byte() = {CByte(rouge), CByte(vert), CByte(bleu)} SerialPort1.Write(tab, 0, 3)
void serialEvent(){ int index =0; int[] tab = new int[3] while (Serial.available() & index < 3) { tab[index] = (int)Serial.read(); index++; }
ValA = tab[0]; //etc
Rouge = tab[0]; //etcet j'ai eu des erreurs...
int RougePin = 9;
int VertPin = 10;
int BleuPin = 11;
int Rouge = 0;
int Vert = 0;
int Bleu = 0;
void setup(){
// initialize serial:
Serial.begin(9600);
}
void loop(){
if (Serial.available() > 0) {
}
}
void serialEvent(){
int index =0;
int tab = new int[3];
while (Serial.available()& index < 3) {
index = (int)Serial.read();
index++;
}
}
Serial.available()& index < 3il manque un espace avant le &
int RougePin = 9;
int VertPin = 10;
int BleuPin = 11;
int Rouge = 0;
int Vert = 0;
int Bleu = 0;
int index =0;
int tab = new int[3];
void setup(){
// initialize serial:
Serial.begin(9600);
pinMode(RougePin, OUTPUT);
}
void loop(){
if (Serial.available() > 0) {
Rouge = tab[0];
analogWrite(RougePin, Rouge);
Vert = tab[1];
analogWrite(VertPin, Vert);
Bleu = tab[2];
analogWrite(BleuPin, Bleu);
}
}
void serialEvent(){
int index =0;
int tab = new int[3];
while (Serial.available() & index < 3) {
index = (int)Serial.read();
index++;
}
}
E:\Arduino Projets\Arduino VB.NET Projets\Arduino LED Dimmer\Arduino_LED_Dimmer\Arduino_LED_Dimmer.ino: In function 'void loop()':
Arduino_LED_Dimmer:25: error: invalid types 'int[int]' for array subscript
Rouge = tab[0];
^
Arduino_LED_Dimmer:27: error: invalid types 'int[int]' for array subscript
Vert = tab[1];
^
Arduino_LED_Dimmer:29: error: invalid types 'int[int]' for array subscript
Bleu = tab[2];
^
exit status 1
invalid types 'int[int]' for array subscript
int RougePin = 9; int VertPin = 10; int BleuPin = 11; int Rouge = 0; int Vert = 0; int Bleu = 0; int index =0; int tab = new int[3]; void setup() { // initialize serial: Serial.begin(9600); // 3 pins OUTPOUT pinMode(RougePin, OUTPUT); pinMode(VertPin, OUTPUT); pinMode(BleuPin, OUTPUT); } void loop() { if (Serial.available() > 0) { Rouge = tab[0]; analogWrite(RougePin, Rouge); Vert = tab[1]; analogWrite(VertPin, Vert); Bleu = tab[2]; analogWrite(BleuPin, Bleu); } } void serialEvent() { int index =0; int tab = new int[3]; while (Serial.available() & index < 3) { // intensité LED de 0 à 255 tab[index] = (int)Serial.read(); index++; } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionint tab = new int[3];et devrait l’être comme un tableau
int[] tab = new int[3];
while (Serial.available() && index < 3)sinon ça fait un et bit à bit et non un et logique
int RougePin = 9; int VertPin = 10; int BleuPin = 11; int Rouge = 0; int Vert = 0; int Bleu = 0; int index =0; int[] tab = new int[3]; void setup(){ // initialize serial: Serial.begin(9600); // 3 pins OUTPOUT pinMode(RougePin, OUTPUT); pinMode(VertPin, OUTPUT); pinMode(BleuPin, OUTPUT); } void loop(){ if (Serial.available() > 0) { Rouge = tab[0]; analogWrite(RougePin, Rouge); Vert = tab[1]; analogWrite(VertPin, Vert); Bleu = tab[2]; analogWrite(BleuPin, Bleu); } } void serialEvent(){ int index =0; int[] tab = new int[3]; while (Serial.available() && index < 3) { // intensité LED de 0 à 255 tab[index] = (int)Serial.read(); index++; } }
int RougePin = 9; int VertPin = 10; int BleuPin = 11; int Rouge = 0; int Vert = 0; int Bleu = 0; int index =0; int[] tab = new int[3]; bool nouveauMessage = false; //initialisation du drapeau void setup(){ // initialize serial: Serial.begin(9600); // 3 pins OUTPOUT pinMode(RougePin, OUTPUT); pinMode(VertPin, OUTPUT); pinMode(BleuPin, OUTPUT); } void loop(){ if (nouveauMessage)//si le drapeau signifie l'arrivée d'une nouvelle instruction { nouveauMessage = false; //on le réinitialise aussitôt Rouge = tab[0]; analogWrite(RougePin, Rouge); Vert = tab[1]; analogWrite(VertPin, Vert); Bleu = tab[2]; analogWrite(BleuPin, Bleu); } } void serialEvent(){ int index =0; int[] tab = new int[3]; while (Serial.available() && index < 3) { // intensité LED de 0 à 255 tab[index] = (int)Serial.read(); index++; } nouveauMessage = true; //activation du drapeau }
Arduino_LED_Dimmer:8: error: expected unqualified-id before '[' token
int[] tab = new int[3];
^
E:\Arduino Projets\Arduino VB.NET Projets\Arduino LED Dimmer\Arduino_LED_Dimmer\Arduino_LED_Dimmer.ino: In function 'void loop()':
Arduino_LED_Dimmer:24: error: 'tab' was not declared in this scope
Rouge = tab[0];
^
E:\Arduino Projets\Arduino VB.NET Projets\Arduino LED Dimmer\Arduino_LED_Dimmer\Arduino_LED_Dimmer.ino: In function 'void serialEvent()':
Arduino_LED_Dimmer:35: error: expected unqualified-id before '[' token
int[] tab = new int[3];
^
Arduino_LED_Dimmer:39: error: 'tab' was not declared in this scope
tab[index] = (int)Serial.read();
^
exit status 1
expected unqualified-id before '[' token
int[] tab = new int[3];par
byte tab = new byte[3];
tab[index] = (int)Serial.read();par
index = (byte)Serial.read();
E:\Arduino Projets\Arduino VB.NET Projets\Arduino LED Dimmer\Arduino_LED_Dimmer\Arduino_LED_Dimmer.ino: In function 'void loop()':
Arduino_LED_Dimmer:24: error: invalid types 'byte {aka unsigned char}[int]' for array subscript
Rouge = tab[0];
^
Arduino_LED_Dimmer:26: error: invalid types 'byte {aka unsigned char}[int]' for array subscript
Vert = tab[1];
^
Arduino_LED_Dimmer:28: error: invalid types 'byte {aka unsigned char}[int]' for array subscript
Bleu = tab[2];
^
exit status 1
invalid types 'byte {aka unsigned char}[int]' for array subscript
Imports System Imports System.IO Imports System.IO.Ports Public Class Form1 Dim myPort As Array Dim PortNames() 'Dim connected As Boolean = False 'Dim rouge As Integer = 115 'Dim vert As Integer = 50 'Dim bleu As Integer = 200 Dim rouge As Byte Dim vert As Byte Dim bleu As Byte 'Dim tab As Byte() = {CByte(rouge), CByte(vert), CByte(bleu)} 'Version en developement VB.Net et Arduino 'Date 08-02-2021 'Firmware v0.0.1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load myPort = IO.Ports.SerialPort.GetPortNames() 'Obtiens tous les ports COM disponibles On récupère les ports COM For i = 0 To UBound(myPort) ComboBox1.Items.Add(myPort(i)) Next ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList ComboBox1.Text = ComboBox1.SelectedIndex = 0 ComboBox1.Text = My.Settings.COM 'Ici on vérifie le COM Port qui a été sauvegardé et l'affiche automatiquement dans le ComboBox1 End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click My.Settings.COM = ComboBox1.Text 'Ici une fois le Port COM sélection dans le ComboBox il est sauvegarder pour la réouverture du logiciel My.Settings.Save() 'Sauvegarder le Port COM sélection dans les Settings Try SerialPort1.PortName = ComboBox1.Text 'Set le Serial Port au port COM sélectionné SerialPort1.Open() ComboBox1.Enabled = False Button1.Enabled = False Button2.Enabled = True BtnOn.Enabled = True BtnOff.Enabled = True red_TrackBar.Enabled = True LblRed.Enabled = True SerialPort1.BaudRate = 9600 SerialPort1.DataBits = 8 SerialPort1.Parity = Parity.None SerialPort1.StopBits = StopBits.One SerialPort1.Handshake = Handshake.None SerialPort1.Encoding = System.Text.Encoding.Default SerialPort1.ReadTimeout = 10000 Timer1.Start() 'SerialPort1.Write(TrackBar1.Value & Chr(10)) 'SerialPort1.WriteLine(red_TrackBar.Value.ToString) 'red_TrackBar.Value = rouge 'green_TrackBar.Value = vert 'blue_TrackBar.Value = bleu Dim data(4) As Byte 'Transmet trois bytes data(0) = rouge 'Data pour entrer dans le mode USB Comand data(1) = vert 'Data pour entrer dans le mode 1 pour Short Packet ou 2 pour Message Data, ici 1 data(2) = bleu 'Data reserver SerialPort1.Write(data, 0, 3) 'écrire les données sur le port série Catch ex As Exception Console.WriteLine(ex.Message) MsgBox("COM Port Pas trouvé", MsgBoxStyle.Exclamation) 'Affiche le message COM non found End Try End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click SerialPort1.Close() ComboBox1.Enabled = True Button1.Enabled = True Button2.Enabled = False End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Try Dim i As Single = SerialPort1.ReadExisting LblRed.Text = "Red Value : " & i.ToString LblRed.Text = "Gree Value : " & i.ToString LblRed.Text = "Blue Value : " & i.ToString 'SerialPort1.Write(TrackBar1.Value & Chr(10)) 'SerialPort1.WriteLine(red_TrackBar.Value.ToString) rouge = red_TrackBar.Value vert = green_TrackBar.Value bleu = blue_TrackBar.Value Dim data(4) As Byte 'Transmet trois bytes data(0) = rouge 'Data pour entrer dans le mode USB Comand data(1) = vert 'Data pour entrer dans le mode 1 pour Short Packet ou 2 pour Message Data, ici 1 data(2) = bleu 'Data reserver SerialPort1.Write(data, 0, 3) 'écrire les données sur le port série Catch ex As Exception End Try End Sub Private Sub BtnOn_Click(sender As Object, e As EventArgs) Handles BtnOn.Click red_TrackBar.Value = 255 End Sub Private Sub BtnOff_Click(sender As Object, e As EventArgs) Handles BtnOff.Click red_TrackBar.Value = 0 End Sub End Class
'Version en developement VB.Net et Arduino 'Date 08-02-2021 'Firmware v0.0.1 Imports System.IO.Ports Public Class Form1 ' Private pour toute la Form Private myPort() As String Private rouge, vert, bleu As Byte ' on regroupe les types Private tab As Byte() = New Byte(3) {} ' reserve un tableau de 3 bytes non initialisés avec une valeur définie ''' <summary> ''' chargement de la Form ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load myPort = SerialPort.GetPortNames() 'Obtient tous les ports COM disponibles sous forme d'un tableau de String With Combobox1 ' évite de répéter dans le code For i = 0 To UBound(myPort) .Items.Add(myPort(i)) Next .DropDownStyle = ComboBoxStyle.DropDownList .Text = .SelectedIndex = 0 .Text = My.Settings.COM 'Ici on vérifie le COM Port qui a été sauvegardé et l'affiche automatiquement dans le ComboBox1 End With End Sub ''' <summary> ''' Ouverture SeialPort ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click My.Settings.COM = ComboBox1.Text 'Ici une fois le Port COM sélectionné dans le ComboBox il est sauvegardé pour la réouverture du logiciel My.Settings.Save() 'Sauvegarder le Port COM sélectionné dans les Settings Try With SerialPort1 .PortName = ComboBox1.Text 'Set le Serial Port au port COM sélectionné .Open() End With ComboBox1.Enabled = False Button1.Enabled = False Button2.Enabled = True BtnOn.Enabled = True BtnOff.Enabled = True red_TrackBar.Enabled = True green_TrackBar.Enabled = True blue_TrackBar.Enabled = True LblRed.Enabled = True LblGreen.Enabled = True LblBlue.Enabled = True With SerialPort1 .BaudRate = 9600 .DataBits = 8 .Parity = Parity.None .StopBits = StopBits.One .Handshake = Handshake.None .Encoding = System.Text.Encoding.Default .ReadTimeout = 10000 End With Timer1.Start() Catch ex As Exception Console.WriteLine(ex.Message) MsgBox("COM Port Pas trouvé", MsgBoxStyle.Exclamation) 'Affiche le message COM non trouvé End Try End Sub ''' <summary> ''' Fermeture SerialPort ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click SerialPort1.Close() ComboBox1.Enabled = True Button1.Enabled = True Button2.Enabled = False End Sub ''' <summary> ''' timer ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Try rouge = Convert.ToByte(red_TrackBar.Value) vert = Convert.ToByte(green_TrackBar.Value) bleu = Convert.ToByte(blue_TrackBar.Value) tab = New Byte(){rouge, vert, bleu} SerialPort1.Write(tab, 0, 3) ' écrire les 3 octets sur le port série Catch ex As Exception End Try End Sub ''' <summary> ''' Valeur max pour les TrackBars ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub BtnOn_Click(sender As Object, e As EventArgs) Handles BtnOn.Click SetTrackBarValue(255) End Sub ''' <summary> ''' Valeur min pour les TrackBars ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub BtnOff_Click(sender As Object, e As EventArgs) Handles BtnOff.Click SetTrackBarValue(0) End Sub ''' <summary> ''' Valeurs Max ou Min des TrackBars et affichage dans les Labels ''' </summary> ''' <param name="Valeur"></param> Private Sub SetTrackBarValue(Valeur As Integer) red_TrackBar.Value = Valeur green_TrackBar.Value = Valeur blue_TrackBar.Value = Valeur AfficheLabels() End Sub ''' <summary> ''' Affichage valeurs dans Labels ''' </summary> Private Sub AfficheLabels() LblBlue.Text = "Bleu : " & bleu.ToString LblGreen.Text = "Vert : " & vert.ToString LblRed.Text = "Rouge : " & rouge.ToString End Sub ''' <summary> ''' Action sur TrackBars et affichage Labels ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Red_TrackBar_ValueChanged(sender As Object, e As EventArgs) Handles red_TrackBar.ValueChanged, blue_TrackBar.ValueChanged, red_TrackBar.ValueChanged Dim ControlTrackBar As TrackBar = sender ' récupère le TrackBar sur lequel on vient d'agir Select Case ControlTrackBar.Name Case "red_TrackBar" ' TrackBar rouge rouge = Convert.ToByte(ControlTrackBar.Value) Case "green_TrackBar" ' TrackBar vert vert = Convert.ToByte(ControlTrackBar.Value) Case "blue_TrackBar" ' TrackBar bleu bleu = Convert.ToByte(ControlTrackBar.Value) End Select AfficheLabels() End Sub End Class
'Version en developement VB.Net et Arduino 'Date 08-02-2021 'Firmware v0.0.1 Imports System.IO.Ports Public Class Form1 ' Private pour toute la Form Private myPort() As String Private rouge, vert, bleu As Byte ' on regroupe les types Private tab As Byte() = New Byte(3) {} ' reserve un tableau de 3 bytes non initialisés avec une valeur définie ''' <summary> ''' chargement de la Form ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load myPort = SerialPort.GetPortNames() 'Obtient tous les ports COM disponibles sous forme d'un tableau de String With Combobox1 ' évite de répéter dans le code For i = 0 To UBound(myPort) .Items.Add(myPort(i)) Next .DropDownStyle = ComboBoxStyle.DropDownList .Text = .SelectedIndex = 0 .Text = My.Settings.COM 'Ici on vérifie le COM Port qui a été sauvegardé et l'affiche automatiquement dans le ComboBox1 End With End Sub ''' <summary> ''' Ouverture SeialPort ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click My.Settings.COM = ComboBox1.Text 'Ici une fois le Port COM sélectionné dans le ComboBox il est sauvegardé pour la réouverture du logiciel My.Settings.Save() 'Sauvegarder le Port COM sélectionné dans les Settings Try With SerialPort1 .PortName = ComboBox1.Text 'Set le Serial Port au port COM sélectionné .Open() End With ComboBox1.Enabled = False Button1.Enabled = False Button2.Enabled = True BtnOn.Enabled = True BtnOff.Enabled = True red_TrackBar.Enabled = True green_TrackBar.Enabled = True blue_TrackBar.Enabled = True LblRed.Enabled = True LblGreen.Enabled = True LblBlue.Enabled = True With SerialPort1 .BaudRate = 9600 .DataBits = 8 .Parity = Parity.None .StopBits = StopBits.One .Handshake = Handshake.None .Encoding = System.Text.Encoding.Default .ReadTimeout = 10000 End With Catch ex As Exception Console.WriteLine(ex.Message) MsgBox("COM Port Pas trouvé", MsgBoxStyle.Exclamation) 'Affiche le message COM non trouvé End Try End Sub ''' <summary> ''' Fermeture SerialPort ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click SerialPort1.Close() ComboBox1.Enabled = True Button1.Enabled = True Button2.Enabled = False End Sub ''' <summary> ''' Valeur max pour les TrackBars ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub BtnOn_Click(sender As Object, e As EventArgs) Handles BtnOn.Click SetTrackBarValue(255) End Sub ''' <summary> ''' Valeur min pour les TrackBars ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub BtnOff_Click(sender As Object, e As EventArgs) Handles BtnOff.Click SetTrackBarValue(0) End Sub ''' <summary> ''' Valeurs Max ou Min des TrackBars et affichage dans les Labels ''' </summary> ''' <param name="Valeur"></param> Private Sub SetTrackBarValue(Valeur As Integer) red_TrackBar.Value = Valeur green_TrackBar.Value = Valeur blue_TrackBar.Value = Valeur AfficheLabels() End Sub ''' <summary> ''' Affichage valeurs dans Labels et envoi vers SerialPort ''' </summary> Private Sub AfficheLabels() LblBlue.Text = "Bleu : " & bleu.ToString LblGreen.Text = "Vert : " & vert.ToString LblRed.Text = "Rouge : " & rouge.ToString SerialWrite() End Sub ''' <summary> ''' Envoi des 3 couleurs sur le SerialPort ''' </summary> Private Sub SerialWrite() Try rouge = Convert.ToByte(red_TrackBar.Value) vert = Convert.ToByte(green_TrackBar.Value) bleu = Convert.ToByte(blue_TrackBar.Value) tab = New Byte(){rouge, vert, bleu} SerialPort1.Write(tab, 0, 3) ' écrire les 3 octets sur le port série Catch ex As Exception MessageBox.Show("Exception : " & ex.Message) End Try End Sub ''' <summary> ''' Action sur TrackBars et affichage Labels ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> Private Sub Red_TrackBar_ValueChanged(sender As Object, e As EventArgs) Handles red_TrackBar.ValueChanged, blue_TrackBar.ValueChanged, red_TrackBar.ValueChanged Dim ControlTrackBar As TrackBar = sender ' récupère le TrackBar sur lequel on vient d'agir Select Case ControlTrackBar.Name Case "red_TrackBar" ' TrackBar rouge rouge = Convert.ToByte(ControlTrackBar.Value) Case "green_TrackBar" ' TrackBar vert vert = Convert.ToByte(ControlTrackBar.Value) Case "blue_TrackBar" ' TrackBar bleu bleu = Convert.ToByte(ControlTrackBar.Value) End Select AfficheLabels() End Sub End Class
#include <SoftwareSerial.h> SoftwareSerial gtSerial(8, 7); // Arduino RX, Arduino TX int RougePin = 9; int VertPin = 10; byte rxbyte = 0; void setup(){ Serial.begin(9600); // serial / USB port / software serial port pinMode(RougePin, OUTPUT); } //byte rxbyte = 0; // stores received byte void loop(){ // check if byte available from USB port if (Serial.available() > 0) { rxbyte = Serial.read(); Serial.print(" Data:"); Serial.println(rxbyte); } }
void loop() { int index =0; char[] tab = new char[3]; while (Serial.available() && index < 3) { // intensité LED de 0 à 255 tab[index] = Serial.read(); index++; } Rouge = (int)(tab[0]- '0'); Vert = (int)(tab[1]- '0'); Bleu = (int)(tab[2]- '0'); }
E:\Arduino Projets\Arduino VB.NET Projets\Serial Port\Exemple 3\Exemple_3\Exemple_3.ino: In function 'void loop()': Exemple_3:21: error: expected unqualified-id before '[' token char[] tab = new char[3]; ^ Exemple_3:25: error: 'tab' was not declared in this scope tab[index] = Serial.read(); ^ Exemple_3:29: error: 'Rouge' was not declared in this scope Rouge = (int)(tab[0]- '0'); ^ Exemple_3:29: error: 'tab' was not declared in this scope Rouge = (int)(tab[0]- '0'); ^ Exemple_3:30: error: 'Vert' was not declared in this scope Vert = (int)(tab[1]- '0'); ^ Exemple_3:31: error: 'Bleu' was not declared in this scope Bleu = (int)(tab[2]- '0'); ^ E:\Arduino Projets\Arduino VB.NET Projets\Serial Port\Exemple 3\Exemple_3\Exemple_3.ino: At global scope: Exemple_3:35: error: expected declaration before '}' token }
byte tab = new byte[3]; //et plus loin tab[index] = (byte)Serial.read();
8 févr. 2021 à 21:39
Tout d'abord Merci a Karamel d’avoir rendu mon code lisible.
Whismeril, tu as raison je parfaire transmettre 3 bytes que de transmettre du string.
J'ai corriger mon code VB en suivent tes conseil ainsi que celui de Arduino, mais ma question est dans Arduino quand je veux extraire mes trois bytes comment je procède exactement?
Es-que je dois utiliser la variable "index"?
Je ne suis pas sur de bien saisir cette partie!
Merci de ton aide, j'apprécie ;-)
Chris