message d'erreur

bonjour suite a deux projet (horloge anneau ring et bouton sens delay)

j'ai les deux code qui marche indépendamment mes ensemble pas avec plusieurs erreur j'ai corriger une grande partie mes pour le rest j'ai besoin d'aide

le code de l'horloge seul

#include <Wire.h>
#include <RTClib.h>
#include <Adafruit_NeoPixel.h>

#define PIN 13
#define PIXEL 60


Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL, PIN, NEO_GRB + NEO_KHZ800);

RTC_DS1307 RTC; // Establish clock object
DateTime Clock; // Holds current clock time

byte hourval, minuteval, secondval;


void setup() {
 Serial.begin(9600);
  Wire.begin();          // Begin I2C
  RTC.begin();   // begin clock
 
    if (! RTC.isrunning()) {
//  Serial.println("RTC is NOT running!");
  // following line sets the RTC to the date & time this sketch was compiled

  }
 
  //RTC.adjust(DateTime(__DATE__, __TIME__));
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
  strip.setBrightness(255);

}


void loop() {

   
    Clock = RTC.now(); // get the RTC time
   
    secondval = Clock.second();  // get seconds
    minuteval = Clock.minute();  // get minutes
    hourval = Clock.hour();   // get hours


    if(hourval > 11) hourval -= 12; // This clock is 12 hour, if 13-23, convert to 0-11
    hourval = (hourval*60 + minuteval) / 12;   
   
    strip.setPixelColor(hourval, 0x008080);strip.setPixelColor(hourval-1, 0x004040);strip.setPixelColor(hourval+1, 0x004040);
    strip.setPixelColor(hourval-2, 0x001010);strip.setPixelColor(hourval+2, 0x001010);
    strip.setPixelColor(minuteval, 0x800080);
    strip.setPixelColor(minuteval-1, 0x200020);strip.setPixelColor(minuteval+1, 0x200020);
    strip.setPixelColor(secondval, 0x808000);strip.setPixelColor(secondval-1, 0x002F00);strip.setPixelColor(secondval+1, 0x002F00);
    strip.show();
   
     strip.setPixelColor(hourval, 0x000000);strip.setPixelColor(hourval-1, 0x000000);strip.setPixelColor(hourval+1, 0x000000);
    strip.setPixelColor(hourval-2, 0x000000);strip.setPixelColor(hourval+2, 0x000000);
    strip.setPixelColor(minuteval, 0x000000);strip.setPixelColor(minuteval-1, 0x000000);strip.setPixelColor(minuteval+1, 0x000000);
    strip.setPixelColor(secondval, 0x000000);strip.setPixelColor(secondval-1, 0x000000);strip.setPixelColor(secondval+1, 0x000000);
 
  delay(25);


/*
   Serial.print(hourval, DEC);
   Serial.print(':');
  Serial.print(minuteval, DEC);
   Serial.print(':');
   Serial.println(secondval, DEC);
*/



}

le code des bouton

/*
 This is a sample sketch to show how to use the OneButtonLibrary
 to detect click events on 2 buttons in parallel. 
 The library internals are explained at
 http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
 
 Setup a test circuit:
 * Connect a pushbutton to pin A1 (ButtonPin) and ground.
 * Connect a pushbutton to pin A2 (ButtonPin) and ground.
 * The Serial interface is used for output the detected button events.
 
 The Sketch shows how to setup the library and bind 2 buttons to their functions.
 In the loop function the button1.tick and button2.tick functions have to be called as often as you like.
 */

// 01.03.2014 created by Matthias Hertel
// ... and working.

/* Sample output:

Starting TwoButtons...
Button 1 click.
Button 2 click.
Button 1 doubleclick.
Button 2 doubleclick.
Button 1 longPress start
Button 1 longPress...
Button 1 longPress...
Button 1 longPress...
Button 1 longPress stop
Button 2 longPress start
Button 2 longPress...
Button 2 longPress...
Button 2 longPress stop

*/

#include "OneButton.h"

// Setup a new OneButton on pin A1.  
OneButton button1(A1, true);
// Setup a new OneButton on pin A2.  
OneButton button2(A2, true);


// setup code here, to run once:
void setup() {
  // Setup the Serial port. see http://arduino.cc/en/Serial/IfSerial
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  Serial.println("Starting TwoButtons...");

  // link the button 1 functions.
  button1.attachClick(click1);
  button1.attachDoubleClick(doubleclick1);
  button1.attachLongPressStart(longPressStart1);
  button1.attachLongPressStop(longPressStop1);
  button1.attachDuringLongPress(longPress1);

 
} // setup


// main code here, to run repeatedly: 
void loop() {
  // keep watching the push buttons:
  button1.tick();

  // You can implement other code in here or just wait a while 
  delay(10);
} // loop


// ----- button 1 callback functions

// This function will be called when the button1 was pressed 1 time (and no 2. button press followed).
void click1() {
  Serial.println("Button 1 click.");
} // click1


// This function will be called when the button1 was pressed 2 times in a short timeframe.
void doubleclick1() {
  Serial.println("Button 1 doubleclick.");
} // doubleclick1


// This function will be called once, when the button1 is pressed for a long time.
void longPressStart1() {
  Serial.println("Button 1 longPress start");
} // longPressStart1


// This function will be called often, while the button1 is pressed for a long time.
void longPress1() {
  Serial.println("Button 1 longPress...");
} // longPress1


// This function will be called once, when the button1 is released after beeing pressed for a long time.
void longPressStop1() {
  Serial.println("Button 1 longPress stop");
} // longPressStop1

le code des deux avec modification

(a la suite)

#include "OneButton.h"
#include <Wire.h>
#include <RTClib.h>
#include <Adafruit_NeoPixel.h>

OneButton button1(A1, true);
int PIN = 13 ;
int PIXEL = 60 ;
int BOUTON = A1 ;
int fadeAmount = 15 ;
int i = 1;
int luminositer = 255;
int appui1= 0 ;
int appui2 = 0 ;
int appui3 = 0 ;

 /*couleurHeur0 =0x008080;
 couleurHeur1 =0x008080;
 couleurHeur2 =0x008080;
 couleurMinute0 =0x008080;
 couleurMinute1 =0x008080;
 couleurSeconde0 =0x008080;
 couleurSeconde1 =0x008080;*/
 
int buttonState = 0;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL, PIN, NEO_GRB + NEO_KHZ800);

RTC_DS1307 RTC; // Establish clock object
DateTime Clock; // Holds current clock time

int hourval, minuteval, secondval;

//OneButton button1(A1, true);
void setup() {

 //pinMode (BOUTON, INPUT);
 
 Serial.begin(9600);
   while (!Serial) {}
  Wire.begin();          // Begin I2C
  RTC.begin();   // begin clock

button1.tick();
Serial.println("Starting TwoButtons...");

  // link the button 1 functions.
  button1.attachClick(click1);
  button1.attachDoubleClick(doubleappui1);
  button1.attachLongPressStart(longPressStart1);
  button1.attachLongPressStop(longPressStop1);
  button1.attachDuringLongPress(longPress1);
    
 
  //RTC.adjust(DateTime(__DATE__, __TIME__));
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
  strip.setBrightness(luminositer);

}


void loop() {
 buttonState = digitalRead(BOUTON);
 button1.tick();
 if (buttonState == HIGH || i != 0) {
 //Reglage ();
 }
 
 Horloge();

 Serial.print(hourval, DEC);
 Serial.print(':');
 Serial.print(minuteval, DEC);
 Serial.print(':');
 Serial.println(secondval, DEC);
}


void Horloge(){
Clock = RTC.now(); // get the RTC time
   
    secondval = Clock.second();  // get seconds
    minuteval = Clock.minute();  // get minutes
    hourval = Clock.hour();   // get hours


    if(hourval > 11) hourval -= 12; // This clock is 12 hour, if 13-23, convert to 0-11
    hourval = (hourval*60 + minuteval) / 12;   
   
    strip.setPixelColor(hourval, 0x008080);strip.setPixelColor(hourval-1, 0x004040);strip.setPixelColor(hourval+1, 0x004040);
    strip.setPixelColor(hourval-2, 0x001010);strip.setPixelColor(hourval+2, 0x001010);
    strip.setPixelColor(minuteval, 0x800080);
    strip.setPixelColor(minuteval-1, 0x200020);strip.setPixelColor(minuteval+1, 0x200020);
    strip.setPixelColor(secondval, 0x808000);strip.setPixelColor(secondval-1, 0x002F00);strip.setPixelColor(secondval+1, 0x002F00);
    strip.show();
   
    strip.setPixelColor(hourval, 0x000000);strip.setPixelColor(hourval-1, 0x000000);strip.setPixelColor(hourval+1, 0x000000);
    strip.setPixelColor(hourval-2, 0x000000);strip.setPixelColor(hourval+2, 0x000000);
    strip.setPixelColor(minuteval, 0x000000);strip.setPixelColor(minuteval-1, 0x000000);strip.setPixelColor(minuteval+1, 0x000000);
    strip.setPixelColor(secondval, 0x000000);strip.setPixelColor(secondval-1, 0x000000);strip.setPixelColor(secondval+1, 0x000000);
 
  delay(25);

}

 void Reglage (){


 switch(i){
 case 0:{
 loop();
 break;
 }
 
 case 1:{ //luminositer
 button1.tick();
 
 
 if (appui1 == 1){
 
 if (fadeAmount == 51){
 fadeAmount = 15; 
 }
 
 luminositer = luminositer + fadeAmount;
 
    //reverse the direction of the fading at the ends of the fade:
 if (luminositer <= 0 || luminositer >= 255) {
 fadeAmount = -fadeAmount;
 }
 
 appui1 = 0;
 Serial.println(luminositer);
 }
 else if (appui2 == 1){
 
 if (fadeAmount == 15){
 fadeAmount = 51; 
 }
 
 luminositer = luminositer + fadeAmount;
 
 //reverse the direction of the fading at the ends of the fade:
 if (luminositer <= 0 || luminositer >= 255) {
 fadeAmount = -fadeAmount;
 }
 
 appui2 = 0;
 Serial.println(luminositer);

 
 
 }
 else if (appui3 == 1){}
 
 i=i++;
 
 }
 
 /*case 2:{ //heur 
 
 }
 
 case 3:{ //minute
 
 }
 
 case 4:{ //seconde
 
 }
 
 case 5:{ //couleur
 
 }
 
 case 6:{ //mode
 
 button1.tick();
 
 if (appui1 == 1){
 
 }
 
 else if (appui2 == 1){
 
 }
 
 else if (appui3 == 1){
 i =0;
 
 }
 }
 }*/
}



void click1() {
 appui1 = 1;
 Serial.println("Button 1 click.");
} // appui1


// This function will be called when the button1 was pressed 2 times in a short timeframe.
void doubleappui1() {
 appui2 = 1;
 Serial.println("Button 1 doubleclick.");
} // doubleappui1


// This function will be called once, when the button1 is pressed for a long time.
void longPressStart1() {
  Serial.println("Button 1 longPress start");
} // longPressStart1


// This function will be called often, while the button1 is pressed for a long time.
void longPress1() {
  Serial.println("Button 1 longPress...");
} // longPress1


// This function will be called once, when the button1 is released after beeing pressed for a long time.
void longPressStop1() {
  Serial.println("Button 1 longPress stop");
} // longPressStop1

code erreur arrive
si vous voyer des chose qui peux étre modifier je prend volontiers ^^

Arduino : 1.8.11 (Windows 10), Carte : "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\killian\Desktop\arduino\horloge_V2\horloge_V2.ino: In function 'void setup()':

horloge_V2:49:23: error: 'click1' was not declared in this scope

   button1.attachClick(click1);

                       ^~~~~~

C:\Users\killian\Desktop\arduino\horloge_V2\horloge_V2.ino:49:23: note: suggested alternative: 'Clock'

   button1.attachClick(click1);

                       ^~~~~~

                       Clock

horloge_V2:50:29: error: 'doubleappui1' was not declared in this scope

   button1.attachDoubleClick(doubleappui1);

                             ^~~~~~~~~~~~

C:\Users\killian\Desktop\arduino\horloge_V2\horloge_V2.ino:50:29: note: suggested alternative: 'appui1'

   button1.attachDoubleClick(doubleappui1);

                             ^~~~~~~~~~~~

                             appui1

horloge_V2:51:32: error: 'longPressStart1' was not declared in this scope

   button1.attachLongPressStart(longPressStart1);

                                ^~~~~~~~~~~~~~~

horloge_V2:52:31: error: 'longPressStop1' was not declared in this scope

   button1.attachLongPressStop(longPressStop1);

                               ^~~~~~~~~~~~~~

horloge_V2:53:33: error: 'longPress1' was not declared in this scope

   button1.attachDuringLongPress(longPress1);

                                 ^~~~~~~~~~

C:\Users\killian\Desktop\arduino\horloge_V2\horloge_V2.ino: In function 'void Reglage()':

horloge_V2:200:15: error: a function-definition is not allowed here before '{' token

 void click1() {

               ^

horloge_V2:207:21: error: a function-definition is not allowed here before '{' token

 void doubleappui1() {

                     ^

horloge_V2:214:24: error: a function-definition is not allowed here before '{' token

 void longPressStart1() {

                        ^

horloge_V2:220:19: error: a function-definition is not allowed here before '{' token

 void longPress1() {

                   ^

horloge_V2:226:23: error: a function-definition is not allowed here before '{' token

 void longPressStop1() {

                       ^

horloge_V2:228:1: error: expected '}' at end of input

 } // longPressStop1

 ^

exit status 1
'click1' was not declared in this scope

Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.

si vous aver besoin du détaillé dite le moi

C'est dû a un problème d'accolade en trop ou mal placer

@+

Déplace les fonctions avant le setup. Tu mets les fonctions, puis le setup puis la loop (dans cet ordre). D'une manière générale, toute fonction qui peut être appelée par une autre fonction devrait être placée avant dans ton code.

Parfois, le compilateur ne se formalise pas trop et arrive à tout reconnaître, mais parfois il n'y arrive pas. Si tu fais ça, tu lui facilites la vie...

De plus il manque une accolade fermante à la fin de la fonction Reglage (avant click1). Pour voir ça simplement, pense à faire CTRL T dans l'IDE : ça corrige l'indentation et te permet de voir mieux les blocs.

merci sa remarche