Fichier ino (Arduino)

Forums Administration du forum Suggestions Fichier ino (Arduino)

  • Ce sujet est vide.
15 sujets de 1 à 15 (sur un total de 15)
  • Auteur
    Messages
  • #79588
    Anonyme

      Salut les modo/admin. du site :)

      Serais t’il possible d’accepter les fichiers de type ino (Arduino) dans l’onglet “transférer une pièce jointe”? Car j’ai voulut mettre un code Arduino et ce n’était pas possible…

      Merci les gars :dance:

      #110406
      Anonyme

        Très bonne idée ! Je plussoie la demande :D

        #110407
        Anonyme

          très bonne idée. :P

          #110408
          Anonyme

            On en rêvait tous mais on n’osait pas le demander :mrgreen:

            c’est vrai que ça serait pratique, surtout que l’éditeur du forum enlève les indentations et mange même les espaces en début de ligne, le gourmand… :)

            Sinon, on pourrait aussi de créer un espace échange de fichiers, temporaire ou pas, genre ´boite de dépôt´, bref une drop box ou encore des galeries par builders…? Informaticiens, a vos claviers :D

            #110409
            Xoff
            Participant

              Code:



              hello,

              vous vouyez que cela ne mange pas les espaces
              et ni l’identitation

              il suffit juste de mettre votre code entre les balises
              ça permet de voir le code tel qu’il est, en pièce attachée, vous ne verrez pas le code, il faudra ouvrir la pièce attachée
              [code]
              ça permet de voir le code tel qu’il est, en pièce attachée, vous ne verrez pas le code, il faudra ouvrir la pièce attachée

              #110410
              Anonyme

                Cool, on a déjà appris quelque chose ;)

                #110411
                kethry
                Bloqué

                  Pour les attachements ayant un format non accepté (donc par exemple les .ino), je conseille d’attacher un fichier zippé

                  ça passe et cerise sur le gâteau, cela prends moins de place…

                  Après concernant le partage, c’est vrai que sur un forum les informations ont tendance à être disséminées un peu de partout

                  Un regroupement peut être intéressant, mais là aussi il faut que cela soit organisé sous peine de dérive rapide

                  Si vous avez des propositions, pourquoi pas…

                  #110412
                  Anonyme

                    Juste pour test / exemple d’un vieux programme que je mets à la poubelle

                    Code:

                    #include
                    #include
                    #include

                    #define USESERIAL 1

                    unsigned long timeMSsave = 0;
                    unsigned long timeMinuteSave = 0;
                    unsigned long time5MinutesSave = 0;
                    unsigned long timeMS = 0;
                    int countLoop = 0;
                    int lastCpsSave = 0;
                    int lastCps = 0;

                    #include “RTClib.h”

                    #include “XBee.h”
                    #include
                    RSeries_Framework_XBee rsXBee;
                    int countTX = 0;
                    int countRX = 0;

                    #define THISARDUINO 26
                    RSeries_Framework rSeries;

                    float vccMotors = 0.0;
                    #define VCCMOTORSMIN 10.0
                    #define VCCMOTORSALERT 10.5
                    #define VCCMOTORSYELLOW 11.3
                    #define VCCMOTORSFULL 12.0
                    #define VCCMOTORSMAX 13.0
                    // red=>….alert…yellow=>….green=>……..
                    // 10 10.5 11.3 12 13

                    String vccValueString;

                    // *****************************************************************************************************
                    /*
                    GENIE stuff (display 4D)
                    400 x 240
                    */
                    #include “Picaso_Serial_4DLib.h”
                    #include “Picaso_const4D.h”
                    #define DisplaySerial Serial3
                    Picaso_Serial_4DLib Display(&DisplaySerial);
                    // Reset connector on 4D Display
                    #define GENIE_RESET 22

                    #define NETWORKLEVELX 330
                    #define NETWORKLEVELY 0

                    #define MYCOLOR 28639
                    //#define

                    const char *Error4DText[] = {“OK”, “Timeout”, “NAK”, “Length”, “Invalid”} ;

                    void genieCallback(int ErrCode, unsigned char Errorbyte)
                    {
                    #if defined(USESERIAL)
                    Serial.print(F(“Serial 4D Library reports error “));
                    Serial.print(Error4DText[ErrCode]) ;
                    if (ErrCode == Err4D_NAK)
                    {
                    Serial.print(F(” Err4D_NAK returned data= “));
                    Serial.println(Errorbyte);
                    }
                    else
                    {
                    Serial.print(F(” ??? returned data= “));
                    Serial.println(Errorbyte);
                    }
                    #endif
                    }

                    bool touchAvailable = false;
                    char genieBufferInfo[20] ;
                    int tmpI;

                    int widthMax;
                    int heightMax;
                    word myFont = 0;

                    void displayOff()
                    {
                    Display.gfx_Contrast(OFF);
                    }

                    void displayOn()
                    {
                    Display.gfx_Contrast(ON);
                    }

                    char toString[32];
                    word myPics;

                    void geniePrintOn2(int value)
                    {
                    if(value<10)
                    {
                    Display.putstr("0");
                    dtostrf(value, 1, 0, toString);
                    } else
                    dtostrf(value, 2, 0, toString);
                    Display.putstr(toString);
                    }

                    int saveMinutes = 0;
                    int seconds = 42;
                    int minutes = 59;
                    int hours = 9;
                    #define hourPosition 354

                    void genieDisplayTime()
                    {
                    //Display.gfx_RectangleFilled(hourPosition,4,395,15, MYCOLOR);
                    Display.img_SetPosition(myPics, 14, hourPosition, 0);
                    Display.img_Show(myPics, 14);
                    //Display.txt_FGcolour(MYCOLOR);
                    Display.gfx_MoveTo(hourPosition,4);
                    geniePrintOn2(hours);
                    Display.putstr(":");
                    geniePrintOn2(minutes);
                    }

                    void horloge()
                    {
                    seconds ++;
                    if(seconds>59) {
                    seconds -= 60;
                    minutes ++;
                    if(minutes>59) {
                    minutes -= 60;
                    hours ++;
                    if(hours>23)
                    hours -= 24;
                    }
                    }
                    if(minutes != saveMinutes)
                    {
                    saveMinutes = minutes;
                    genieDisplayTime();
                    }
                    }

                    int numB = 1;

                    //void genieDisplayBattery(int position)
                    //{
                    // Display.gfx_Transparency(1);
                    // //genieDisplayLocalBattery(sequence);
                    // Display.img_SetPosition(myPics, numB, 220, 1);
                    // Display.img_Show(myPics, numB);
                    // numB++;
                    // if(numB == 7)
                    // numB = 0;
                    // Display.gfx_Transparency(0);
                    //}

                    void genieDisplayLocalBattery(int position, int value)
                    {
                    Display.gfx_Transparency(1);
                    Display.img_SetPosition(myPics, value, 55 * position, 1);
                    Display.img_Show(myPics, value);
                    Display.gfx_Transparency(0);
                    }

                    //void genieDisplayNetwork()
                    //{
                    // Display.img_SetPosition(myPics, 10, NETWORKLEVELX, 1);
                    // Display.img_Show(myPics, 10);
                    //}

                    //bool displaySpace = true;

                    void writeText(char * texte)
                    {
                    //if(displaySpace)
                    // Display.putstr(” “);
                    Display.putstr(texte);
                    //displaySpace = false;
                    }

                    void writeTextLine(char * texte)
                    {
                    //if(displaySpace)
                    // Display.putstr(” “);
                    Display.putstr(texte);
                    Display.putstr(“n”);
                    //displaySpace = true;
                    }

                    int currentPage = -1;
                    bool loadingPage = false;
                    #define WINDOWLEFT 46
                    #define WINDOWTOP 30
                    #define LINEHEIGHT 12

                    void clearPage()
                    {
                    loadingPage = true;
                    Display.gfx_MoveTo(WINDOWLEFT, WINDOWTOP);
                    Display.img_SetPosition(myPics, 12, 41, 23);
                    Display.img_Show(myPics, 12);
                    }

                    void displayPageBios()
                    {
                    if(loadingPage) return;
                    if(currentPage == 0) return;
                    currentPage = 0;
                    clearPage();
                    //Display.txt_MoveCursor(3, 0);
                    //writeTextLine(“”); writeTextLine(“”); writeTextLine(“”);
                    writeTextLine(“Industrial Automaton”);
                    writeTextLine(“R-Series Droid Modular BIOS v1.01”);
                    writeTextLine(“Copyright (c) 2013, BorisSoft”);
                    writeTextLine(“”);
                    writeText(“Mount drive: “);
                    dtostrf(myPics, 5, 0, toString); writeTextLine(toString);
                    writeText(“Display model: “);
                    writeTextLine(genieBufferInfo);
                    tmpI = strlen(genieBufferInfo) ;
                    writeText(“SPE2 Version: “); dtostrf(Display.sys_GetVersion(), 4, 0, toString); writeTextLine(toString);
                    writeText(“PmmC Version: “); dtostrf(Display.sys_GetPmmC(), 4, 0, toString); writeTextLine(toString);
                    writeText(“Resolution: “); dtostrf(widthMax, 3, 0, toString); writeText(toString); writeText(“x”); dtostrf(heightMax, 3, 0, toString); writeTextLine(toString);
                    if ((genieBufferInfo[tmpI] == ‘T’) || (genieBufferInfo[tmpI-1] == ‘T’) || (genieBufferInfo[tmpI-2] == ‘T’))
                    {
                    touchAvailable = true ;
                    Display.txt_FGcolour(LIGHTGREEN);
                    writeTextLine(“Touch: available”);
                    } else {
                    Display.txt_FGcolour(RED);
                    writeTextLine(“Touch: not available”);
                    }
                    Display.txt_FGcolour(MYCOLOR);
                    // logo boot
                    Display.img_SetPosition(myPics, 13, 313, 54);
                    Display.img_Show(myPics, 13);
                    writeTextLine(“”);
                    writeTextLine(“Arduino Mega 2560 Revision 3”);
                    writeTextLine(“ATmega2560 16 MHz 5V”);
                    writeTextLine(“Flash Memory: 256 KB”);
                    writeTextLine(“”);
                    loadingPage = false;
                    }

                    #define TABVCC1 80
                    #define TABVCC2 136
                    #define TABVCC3 190
                    #define TABVCC4 250
                    char text[256];

                    int leftPrint = 0;
                    int firstTab = 0;

                    void displayInfo(char * title, int posY)
                    {
                    Display.gfx_MoveTo(leftPrint, WINDOWTOP + LINEHEIGHT * posY);
                    writeText(title);
                    }

                    void displayInfoValue(char * title, int posY, int value)
                    {
                    Display.gfx_MoveTo(leftPrint, WINDOWTOP + LINEHEIGHT * posY);
                    writeText(title); writeText(“:”);
                    Display.gfx_MoveTo(leftPrint + firstTab, WINDOWTOP + LINEHEIGHT * posY);
                    sprintf(text, “%d”, value);
                    Display.putstr(text);
                    }

                    void displayInfoVcc(char * title, int posY, String value, int seconds)
                    {
                    Display.gfx_MoveTo(WINDOWLEFT, WINDOWTOP + LINEHEIGHT * posY);
                    writeText(title);writeText(“:”);
                    //char * un = const_cast(value.c_str());
                    Display.gfx_MoveTo(WINDOWLEFT + TABVCC1, WINDOWTOP + LINEHEIGHT * posY);
                    Display.putstr(const_cast(value.c_str())); writeText(“V”);
                    Display.gfx_MoveTo(WINDOWLEFT + TABVCC2, WINDOWTOP + LINEHEIGHT * posY);
                    sprintf(text, “%d”, seconds);
                    writeText(text); writeText(” s”);
                    Display.gfx_MoveTo(WINDOWLEFT + TABVCC3, WINDOWTOP + LINEHEIGHT * posY);
                    writeText(” 00:00″);
                    Display.gfx_MoveTo(WINDOWLEFT + TABVCC4, WINDOWTOP + LINEHEIGHT * posY);
                    writeText(” 00:00″);
                    }

                    void displayPageInfo()
                    {
                    if(loadingPage) return;
                    if(currentPage == 1) return;
                    currentPage = 1;
                    clearPage();
                    writeText(“BATTERIES”);
                    Display.gfx_MoveTo(WINDOWLEFT + TABVCC2, WINDOWTOP);
                    writeText(“LAST”);
                    Display.gfx_MoveTo(WINDOWLEFT + TABVCC3, WINDOWTOP);
                    writeText(“TOTAL”);
                    Display.gfx_MoveTo(WINDOWLEFT + TABVCC4, WINDOWTOP);
                    writeText(“ESTIMATE”);
                    displayInfoVcc(“Emitter”, 1, vccValueString, 1);
                    displayInfoVcc(“Receiver”, 2, vccValueString, 2);
                    displayInfoVcc(“Music”, 3, vccValueString, 3);
                    displayInfoVcc(“Dome”, 4, vccValueString, 4);
                    displayInfoVcc(“Wheels”, 5, vccValueString, 5);

                    leftPrint = WINDOWLEFT; firstTab = TABVCC1;
                    displayInfo(“RADIO”, 7);
                    displayInfoValue(“Signal”, 8, rsXBee.rssi); writeText(” dB”);
                    displayInfoValue(“Send”, 9, countTX);
                    displayInfoValue(“Receive”, 10, countRX);

                    displayInfo(“CPU”, 12);
                    displayInfoValue(“Loop av.”, 13, lastCpsSave); writeText(” ms”);

                    leftPrint = TABVCC4;
                    displayInfo(“SOUND”, 7);
                    displayInfoValue(“Bip”, 8, 0);
                    displayInfoValue(“Music”, 9, 0);

                    loadingPage = false;
                    }

                    void genieSetup()
                    {
                    #if defined(USESERIAL)
                    Serial.println(“Starting 4D Screen…”);
                    #endif

                    /*
                    2.5.
                    When the PICASO Display Module comes out of a power-up or external reset, a sequence of events is executed
                    internally. The user should wait at least 3 seconds for the start-up to take place before attempting to
                    communicate with the module.
                    Splash Screen 2.6.
                    The splash screen appears on the screen 5 seconds after the start-up routines have been executed, provided
                    there has been no serial activity.
                    */
                    Display.Callback4D = genieCallback;
                    Display.TimeLimit4D = 5000; // 5 second timeout on all commands

                    Serial.print(“1.”); delay(1000); Serial.print(“2.”); delay(1000); Serial.print(“3.”);
                    //delay(1000);
                    //Serial.print(“4.”); delay(1000); Serial.print(“5.”); delay(1000); Serial.println(“GO”);

                    DisplaySerial.begin(9600);
                    delay(50);
                    DisplaySerial.flush();
                    /*
                    Serial.println(“Reset screen”);
                    pinMode(GENIE_RESET, OUTPUT);
                    digitalWrite(GENIE_RESET, 1);
                    delay(100);
                    digitalWrite(GENIE_RESET, 0);
                    delay(100);
                    Display.GetAck();
                    */
                    Display.gfx_ScreenMode(LANDSCAPE);
                    Display.gfx_MoveTo(0, 0);
                    widthMax = Display.gfx_Get(X_MAX)+1;
                    heightMax = Display.gfx_Get(Y_MAX)+1;
                    Display.gfx_BGcolour(BLACK);
                    Display.txt_BGcolour(BLACK);
                    Display.txt_FGcolour(MYCOLOR);
                    Display.gfx_Cls();
                    Display.txt_Opacity(0);
                    Display.gfx_TransparentColour(63519); // #FF00FF RGB565=1111100000011111
                    Display.gfx_Transparency(1);
                    Display.txt_FontID(FONT3);

                    Display.file_Mount();
                    #if defined(USESERIAL)
                    Serial.println(F(“Loading images”)) ;
                    #endif
                    myPics = Display.file_LoadImageControl(“icons.dat”, “icons.gci”, 1) ;
                    Display.img_SetPosition(myPics, 12, 0, 0);
                    Display.img_Show(myPics, 12);

                    Display.sys_GetModel(genieBufferInfo) ; // length is also returned, but we don’t need that here
                    #if defined(USESERIAL)
                    Serial.print(“Display model: “);
                    Serial.println(genieBufferInfo);
                    Serial.print(F(“SPE2 Version: “)) ;
                    Serial.println(Display.sys_GetVersion(),HEX) ;
                    Serial.print(F(“PmmC Version: “)) ;
                    Serial.println(Display.sys_GetPmmC(),HEX) ;
                    #endif
                    //myFont = Display.file_LoadFunction(“SJR~1.4DF”);
                    //Display.txt_FontID(myFont);

                    Display.gfx_Line(36, 20, 399, 20, MYCOLOR);
                    Display.gfx_Line(36, 20, 36, 239, MYCOLOR);
                    // logo
                    Display.img_SetPosition(myPics, 11, 2, 1);
                    Display.img_Show(myPics, 11);
                    // menu
                    for(int m = 0; m < 6; m++) { Display.img_SetPosition(myPics, 15 + m, 2, 34 + m * 34); Display.img_Show(myPics, 15 + m); } Display.gfx_Transparency(0); Display.gfx_MoveTo(1 * 55 - 10, 4); writeText("W"); genieDisplayLocalBattery(1, 6); Display.gfx_MoveTo(2 * 55 - 10, 4); writeText("D"); genieDisplayLocalBattery(2, 6); Display.gfx_MoveTo(3 * 55 - 10, 4); writeText("M"); genieDisplayLocalBattery(3, 6); Display.gfx_MoveTo(4 * 55 - 10, 4); writeText("R"); genieDisplayLocalBattery(4, 6); Display.gfx_MoveTo(5 * 55 - 10, 4); writeText("E"); genieDisplayLocalBattery(5, 6); Display.touch_Set(TOUCH_ENABLE); Display.touch_Set(TOUCH_REGIONDEFAULT); // par défaut, on affiche les infos de boot displayPageBios(); } // ***************************************************************************************************** /* NUNCHUCK */ /* http://tutoarduino.com/comment-controler-un-servomoteur-avec-un-nunchuck-de-wii http://www.gabrielbianconi.com/arduinonunchuk/ https://github.com/GabrielBianconi/ArduinoNunchuk/blob/master/ArduinoNunchuk/ArduinoNunchuk.cpp */ #define NUNCHUK_I2C_ADDRESS 0x52 int counterNunchuckBuffer; uint8_t nunchuckBuffer[6]; bool nunchuckZisPressed = false; bool nunchuckCisPressed = false; void setupNunchuck() { Wire.beginTransmission(NUNCHUK_I2C_ADDRESS); Wire.write(0xF0); Wire.write(0x55); Wire.endTransmission(); delay(10); Wire.beginTransmission(NUNCHUK_I2C_ADDRESS); Wire.write(0xFB); Wire.write(0x00); Wire.endTransmission(); delay(10); } void readNunchuck() { Wire.requestFrom(NUNCHUK_I2C_ADDRESS, 6); counterNunchuckBuffer = 0; while (Wire.available ()) { nunchuckBuffer[counterNunchuckBuffer] = Wire.read(); counterNunchuckBuffer++; } Wire.beginTransmission(NUNCHUK_I2C_ADDRESS); Wire.write(0x00);Wire.write(0x00); Wire.endTransmission(); delay(10); if(counterNunchuckBuffer >= 5)
                    {
                    uint8_t joy_x_axis = nunchuckBuffer[0];
                    uint8_t joy_y_axis = nunchuckBuffer[1];
                    uint8_t accel_x_axis = (nunchuckBuffer[2] << 2) | ((nunchuckBuffer[5] >> 2) & 3);
                    uint8_t accel_y_axis = (nunchuckBuffer[3] << 2) | ((nunchuckBuffer[5] >> 4) & 3);
                    uint8_t accel_z_axis = (nunchuckBuffer[4] << 2) | ((nunchuckBuffer[5] >> 6) & 3);
                    uint8_t z_button = !((nunchuckBuffer[5] >> 0) & 1);
                    uint8_t c_button = !((nunchuckBuffer[5] >> 1) & 1);
                    /*
                    Serial.print(“joy:”); Serial.print(joy_x_axis,DEC); Serial.print(“,”); Serial.print(joy_y_axis, DEC);
                    Serial.print(” t”);
                    Serial.print(“acc:”); Serial.print(accel_x_axis, DEC); Serial.print(“,”); Serial.print(accel_y_axis, DEC); Serial.print(“,”); Serial.print(accel_z_axis, DEC);
                    Serial.print(“t”);
                    Serial.print(“but:”); Serial.print(z_button, DEC); Serial.print(“,”); Serial.print(c_button, DEC);
                    Serial.print(“rn”);
                    */
                    if(z_button == 1)
                    {
                    if(!nunchuckZisPressed)
                    {
                    nunchuckZisPressed = true;
                    rsXBee.send(0, 0xA0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                    countTX++;
                    }
                    } else nunchuckZisPressed = 0;
                    if(c_button == 1)
                    {
                    if(!nunchuckCisPressed)
                    {
                    nunchuckCisPressed = true;
                    rsXBee.send(0, 0xA1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                    countTX++;
                    }
                    } else nunchuckCisPressed = false;
                    }
                    }

                    // *****************************************************************************************************
                    /*
                    VCC
                    */

                    // Set this to which Analog Pin you use for the voltage in.
                    #define VCCANALOGINPUT 0

                    float chargeVCC = 12.2; // Voltage at which system is charging
                    float greenVCC = 10.6;
                    float yellowVCC = 10.2;
                    float orangeVCC = 9.8;
                    float redVCC = 9.4;
                    float emptyVCC = 9.0;

                    // For 15volts: R1=47k, R2=24k
                    // For 30volts: R1=47k, R2=9.4k
                    float R1 = 46800.0; // >> resistance of R1 in ohms << the more accurate these values are float R2 = 23980.0; // >> resistance of R2 in ohms << the more accurate the measurement will be int vccAnalogRead = 0; // used to hold the analog value coming out of the voltage divider int vccOldRead = 0; float vout = 0.0; // for voltage out measured analog input float vin = 0.0; // voltage calulcated... since the divider allows for 15 volts String vccValueStringOld = "0"; int vccHistoricalValues[16]; int vccHistocalPointer = 0; unsigned long vccAverage; int16_t vccValueToSend = 0; void setupVCC() { pinMode(VCCANALOGINPUT, INPUT); } void calculateVCC(){ vccAnalogRead = analogRead(VCCANALOGINPUT); // this must be between 0.0 and 5.0 - otherwise you'll let the blue smoke out of your arduino // we're taking 16 values and making the average of all vccHistoricalValues[vccHistocalPointer] = vccAnalogRead; vccHistocalPointer++; if(vccHistocalPointer == 16) vccHistocalPointer = 0; vccAverage = 0; for(int i=0; i<16; i++) vccAverage += vccHistoricalValues[i]; vccAnalogRead = vccAverage >> 4;
                    // no change
                    if(vccOldRead == vccAnalogRead) return;
                    vccOldRead = vccAnalogRead;
                    vout = (vccAnalogRead * 5.0) / 1024.0; //voltage coming out of the voltage divider
                    vin = vout / (R2/(R1+R2)); //voltage to display
                    vccValueToSend = vin * 100;
                    vccValueString = rSeries.stringFromFloat(vin, 4, 1);
                    // no change
                    if(vccValueString == vccValueStringOld) return;
                    vccValueStringOld = vccValueString;
                    //rSeries.setSensorValue(Rs_All, RS_SENSOR_MOTORS_VCC, vccValueToSend);
                    if(vin >= chargeVCC)
                    genieDisplayLocalBattery(5, 0);
                    else if(vin >= greenVCC)
                    genieDisplayLocalBattery(5, 1);
                    else if(vin >= yellowVCC)
                    genieDisplayLocalBattery(5, 2);
                    else if(vin >= orangeVCC)
                    genieDisplayLocalBattery(5, 3);
                    else if(vin >= redVCC)
                    genieDisplayLocalBattery(5, 4);
                    else if(vin >= emptyVCC)
                    genieDisplayLocalBattery(5, 5);
                    else
                    genieDisplayLocalBattery(5, 6);

                    #if defined(USESERIAL)
                    Serial.print(vccValueString); Serial.print(” “);
                    #endif
                    }

                    // *****************************************************************************************************
                    /*
                    Real Time Clock
                    */

                    RTC_DS1307 RTC;
                    DateTime now = DateTime(__DATE__, __TIME__);

                    void refreshTime()
                    {
                    now = RTC.now();
                    hours = now.hour();
                    minutes = now.minute();
                    seconds = now.second();
                    #if defined(USESERIAL)
                    Serial.print(now.year(), DEC);
                    Serial.print(‘/’);
                    Serial.print(now.month(), DEC);
                    Serial.print(‘/’);
                    Serial.print(now.day(), DEC);
                    Serial.print(‘ ‘);
                    Serial.print(now.hour(), DEC);
                    Serial.print(‘:’);
                    Serial.print(now.minute(), DEC);
                    Serial.print(‘:’);
                    Serial.print(now.second(), DEC);
                    Serial.println();
                    #endif
                    }

                    // *****************************************************************************************************
                    /*
                    NETWORK – XBEE emitter
                    */

                    byte networkLevel = 0;

                    void receivedNetworkLevel(byte value)
                    {
                    //Serial.println(value);
                    networkLevel = value; // to show on screen
                    int img = 7 + value;
                    if(img >= 0) {
                    if(img>10)
                    img = 10;
                    //Display.gfx_RectangleFilled(NETWORKLEVELX, NETWORKLEVELY, NETWORKLEVELX + 16, NETWORKLEVELY + 16, BLACK);
                    Display.gfx_Transparency(1);
                    Display.img_SetPosition(myPics, img, NETWORKLEVELX, NETWORKLEVELY);
                    Display.img_Show(myPics, img);
                    Display.gfx_Transparency(0);
                    }
                    }

                    //char charBufferToConvertNum[32];

                    void receivedCommand(byte from, RsCommand command, byte nb, int value, int value2, int value3, int value4)
                    {
                    countRX++;
                    //Serial.println(command);
                    switch (command)
                    {
                    case RS_SENSOR_MOTORS_VCC:
                    vccMotors = (float)value/100;
                    #if defined(USESERIAL)
                    Serial.print(“Vcc:”); Serial.println(vccMotors);
                    #endif
                    //test = rSeries.stringFromFloat(vccMotors, 4, 1);
                    //genieWriteStr(0, dtostrf(vccMotors, 4, 1, charBufferToConvertNum));
                    break;
                    default:
                    break;
                    }
                    }

                    word touchState = 0;
                    word touchX = 0;
                    word touchY = 0;

                    void detectTouch()
                    {
                    touchState = Display.touch_Get(TOUCH_STATUS);
                    if(touchState == NOTOUCH) return;
                    //Serial.print(“touch “); Serial.println(touchState);
                    if(touchState != TOUCH_RELEASED) return;
                    touchX = Display.touch_Get(TOUCH_GETX);
                    touchY = Display.touch_Get(TOUCH_GETY);
                    // on touche le menu de gauche
                    if(touchX < WINDOWLEFT) { if(touchY > 34 && touchY < 68) { Display.file_PlayWAV("Space.WAV"); displayPageBios(); return; } if(touchY > 68 && touchY < 102) { displayPageInfo(); return; } if(touchY > 102 && touchY < 136) { return; } if(touchY > 136 && touchY < 170) { return; } if(touchY > 170 && touchY < 204) { return; } return; } if(touchY < WINDOWTOP) { return; } // action de l'utilisateur est fonction de la page affichée if(currentPage == 0) { // aucune action sur cette page return; } else if(currentPage == 1) { // on refresh l'affichage currentPage = -1; displayPageInfo(); return; } else if(currentPage == 2) { return; } else if(currentPage == 3) { return; } else if(currentPage == 4) { return; } else if(currentPage == 5) { return; } } bool isSecond = true; void demiSecond(int16_t sequence) { //genieDisplayBattery(sequence); calculateVCC(); isSecond = !isSecond; if(isSecond) { horloge(); } } void setup() { #if defined(USESERIAL) Serial.begin(115200); delay(500); Serial.println("Boris Controller"); #endif genieSetup(); writeText("LOAD XBEE"); Serial2.begin(19200); rsXBee.setup(Serial2, receivedNetworkLevel); rSeries.setup(THISARDUINO, Rs_Emitter | Rs_Sensors, receivedCommand); #if defined(USESERIAL) Serial.println("Hello World!"); #endif // starting I2C network Wire.begin(); writeText(" / RTC"); if (! RTC.isrunning()) { writeText("(no)"); Serial.println("RTC is NOT running!"); RTC.adjust(now); } refreshTime(); writeText(" / NUNCHUK"); setupNunchuck(); writeText(" / VCC"); setupVCC(); //genieDisplayTime(); //genieDisplayBattery(0); //genieDisplayNetwork(); rSeries.doJobEvery(demiSecond, 500); rSeries.startJob(); } bool isFirst = true; bool hasSent = false; void loop() { countLoop++; timeMS = millis(); // every second if((timeMS - timeMSsave) > 1000) {
                    lastCps = 1000 / countLoop;
                    if(lastCps != lastCpsSave) {
                    lastCpsSave = lastCps;
                    #if defined(USESERIAL)
                    Serial.print(countLoop);
                    Serial.print(” cps=”);
                    Serial.print(lastCps);
                    Serial.println(“ms”);
                    #endif
                    }
                    countLoop = 0;
                    timeMSsave = millis();
                    // every minute
                    if((timeMS – timeMinuteSave) > 60000) {
                    timeMinuteSave = millis();
                    // every 5 minutes
                    if((timeMS – time5MinutesSave) > 300000) {
                    refreshTime();
                    time5MinutesSave = millis();
                    }
                    }
                    }
                    readNunchuck();
                    rSeries.loop();
                    rsXBee.loop();

                    if(isFirst)
                    {
                    if(!hasSent)
                    {
                    //rsXBee.send(0, 0xA1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                    hasSent = true;
                    return;
                    }
                    isFirst = false;
                    }

                    detectTouch();
                    }

                    /*
                    1 – allumage controller
                    2 – allumage R2
                    ASSOCIATE sur R2
                    ZB_IO_NODE_IDENTIFIER_RESPONSE sur controller

                    1 – allumage R2
                    2 – allumage controller
                    idem TRIGGER de chaque côté

                    si débranche controller puis rebranche : plus aucun trigger
                    si débranche R2 puis rebranche : à nouveau trigger

                    AI 0x21 – Scan found no PANs

                    */

                    #110413
                    Anonyme

                      Allez, avec une bonne coloration syntaxique en plus et je dis ok ;) (parce que le coup du je zip avant, bof bof, c’est comme la limite de taille des images que l’on doit retoucher avant de publier… du coup je ne publie plus)

                      #110414
                      kethry
                      Bloqué

                        pour les images OK c’est pénible, mais l’espace sur un forum est très important et (vous me corrigerez, je me trompe peut être) une taille limite empêche que les utilisateurs postent n’importe quoi… tout le monde n’est pas responsable ou n’a pas forcément les connaissances informatiques pour penser à ça.

                        pour le code, pas d’accord…

                        poster du code d’exemple dans un article pour illustrer un propos, OK.

                        joindre du code (par exemple un .ino entier) que tout le monde doit copier coller pour pouvoir l’utiliser, je dis: plus que bof

                        la personne qui poste économise 5 secondes et toutes les personnes qui utilisent perdent 1 minute sans compter les risques d’erreurs (j’exagère un peu, mais bon)

                        c’est mon avis perso, mais le code copier collé on ne sait pas trop comment dans un “/quote” ça m’agace (sauf à titre d’illustration)…

                        cela dit, je vais autoriser les .ino, ce ne sont pas de gros fichiers en général, donc OK

                        #110415
                        kethry
                        Bloqué

                          test du fichier ino de boris que j’ai mis 1 minute à copier coller et qui mange 26Ko d’espace 😆

                          #110416
                          Anonyme

                            Xoff wrote:

                            pour les images OK c’est pénible, mais l’espace sur un forum est très important et (vous me corrigerez, je me trompe peut être) une taille limite empêche que les utilisateurs postent n’importe quoi… tout le monde n’est pas responsable ou n’a pas forcément les connaissances informatiques pour penser à ça.


                            si le gars n’a pas la connaissance, imagine que tu le forces à redimensionner ! Tu crois que le gars sait faire ???? J’ai des doutes…

                            Pour moi la solution : c’est au forum de réduire les images jugées trop grandes lors de la publication.

                            Regarde, juste en cours maintenant : notre ami prostreetnotch en train de galérer. Il a tout publié aux US sans souci et ici il est en train de galérer et de chercher un hébergeur pour pouvoir poster les avancés de son Numéro 2.

                            #110417
                            kethry
                            Bloqué

                              OK, il faut qu’on regarde si un mod permet de faire ça sans rien casser

                              après, sans lancer un débat, concernant Astomech je suis d’accord, mais on ne peut pas comparer leurs moyens et les nôtres

                              chaque appel de cotisation ramène en quelques jours plusieurs centaines, voire milliers de dollars, ils ont plusieurs centaines de membres actifs en simultané, les moyens techniques d’hébergement ne sont donc pas comparables (et il n’y a pas que les problématiques d’espace, il y a également les notions de sauvegardes et de trouver les personnes qui gèrent tout ça)…

                              mais nous allons regarder, le but reste bien entendu que le forum soit le plus intuitif et utilisable possible

                              #110418
                              Anonyme

                                ah ah merci bien Messieurs les Admins / modos :)

                                ça c’est ce que j’appelle réactif ! :welldone:

                                #110419
                                kethry
                                Bloqué

                                  Par contre les remarques de Boris me font penser à quelque chose de frustrant : la disparition inopinée d’images quand un fournisseur externe se met à partir en vrille…

                                  Donc c’est vrai que l’hébergement des images dans le forum est également un plus à ce niveau, à suivre, on vous tiendra informés…

                                15 sujets de 1 à 15 (sur un total de 15)
                                • Vous devez être connecté pour répondre à ce sujet.