Fabrication industrielle
Internet des objets industriel | Matériaux industriels | Entretien et réparation d'équipement | Programmation industrielle |
home  MfgRobots >> Fabrication industrielle >  >> Manufacturing Technology >> Processus de fabrication

Générateur d'ondes JX

Composants et fournitures

Arduino Nano R3
Je ne l'ai pas essayé mais vous pouvez probablement utiliser n'importe quel modèle Arduino
× 1
Affichage SH1106 I2C Oled 128x64 pixels (4 broches)
× 1
Module DDS AD9833
× 1
Encodeur rotatif avec bouton-poussoir
Avec cela, vous avez besoin du fer à souder
× 1
Module d'encodeur rotatif
Pour le montage sur maquette, c'est mieux
× 1
Module relais 5V (facultatif)
Facultatif, s'il n'est pas nécessaire de changer le mode de couplage de sortie AC/DC. c'est mieux
× 1
Relais Reed 5V 500 Ohm
Ce serait mieux pour un petit signal mais nécessite le fer à souder.Avec une bobine de 500 Ohm, il peut être connecté directement aux broches numériques Arduino (10 mA).
× 1
Condensateur 10 µF
× 1
Condensateur 10 nF
Condensateur en polyester
× 1
Alimentation abaisseur AC-DC 100-220V à 5V module
En option, pour alimenter le circuit lorsqu'il n'est pas connecté via USB
× 1

Outils et machines nécessaires

Fer à souder (générique)
Ce n'est pas indispensable si vous voulez tester le projet sur une maquette

Applications et services en ligne

image2cpp
Pour convertir vos icônes personnalisées au format hexadécimal pour PROGMEM

À propos de ce projet

J'ai longtemps repoussé l'achat d'un oscilloscope. Maintenant, après l'avoir acheté, il est temps d'avoir également un générateur de signal peu coûteux pour une utilisation amateur, essentiel pour diagnostiquer les circuits audio et plus encore. Alliant les deux passions de l'électronique et de l'informatique, le mieux est de le faire soi-même avec Arduino.

CARACTÉRISTIQUES

  • Fréquence de sortie entre 1 Hz et 999999 Hz
  • deux modes de variation de fréquence :logarithmique et à un chiffre
  • trois types d'onde, sinus, triangulaire et carré
  • Couplage de sortie CA ou CC
  • possibilité de balayer en continu entre deux valeurs de fréquence prédéfinies
  • contrôlé exclusivement par un seul bouton
  • économiseur d'écran intégré pour préserver la durée de vie de l'écran Oled

REMARQUE

RÉFÉRENCES RAPIDES

PROTOTYPE

J'ai utilisé un module relais pré-assemblé qui a des contacts 10A, car pour le moment je n'avais pas de relais micro reed, ce serait le meilleur choix pour éviter les diodes à transistor et la résistance, lorsque les relais de puissance ne sont pas nécessaires. Un code PIN numérique Arduino peut fournir un maximum de 40 mA, vous ne pouvez donc pas connecter directement un relais électromécanique avec une bobine 120/150 ohms.

SOYEZ TOUJOURS TRÈS TRÈS PRUDENT lors de l'utilisation de la tension secteur !

Risque de choc électrique et/ou de dommages à votre peau et à vos yeux.
Prenez soin de votre vie vous n'en avez qu'une !

Code

  • JX_Wave_Generator_8.7.7.ino
  • JXWG_Defs.h
  • JXWG_Graphics.h
JX_Wave_Generator_8.7.7.inoC/C++
Version 8.7.7. Révision mineure le 16/01/2021
/* Copyright (c) 2020 Janux L'autorisation est par la présente accordée, gratuitement, à toute personne obtenant une copie de ce logiciel et des fichiers de documentation associés (le "Logiciel"), pour traiter dans le Logiciel sans restriction, y compris, sans limitation, les droits d'utilisation, de copie, de modification, de fusion, de publication, de distribution, de sous-licence et/ou de vente de copies du Logiciel, et d'autoriser les personnes à qui le Logiciel est fourni à le faire, sous réserve aux conditions suivantes :L'avis de droit d'auteur ci-dessus et cet avis d'autorisation doivent être inclus dans toutes les copies ou parties substantielles du logiciel. LE LOGICIEL EST FOURNI « EN L'ÉTAT », SANS GARANTIE D'AUCUNE SORTE, EXPRESSE OU IMPLICITE, Y COMPRIS, MAIS SANS S'Y LIMITER, LES GARANTIES DE QUALITÉ MARCHANDE, D'ADAPTATION À UN USAGE PARTICULIER ET D'ABSENCE DE CONTREFAÇON. EN AUCUN CAS, LES AUTEURS OU TITULAIRES DE DROITS D'AUTEUR NE SERONT RESPONSABLES DE TOUTE RÉCLAMATION, DOMMAGES OU AUTRE RESPONSABILITÉ, QU'IL SOIT DANS UNE ACTION DE CONTRAT, DÉLIT OU AUTRE, DÉCOULANT DE, OU EN RELATION AVEC LE LOGICIEL OU L'UTILISATION OU D'AUTRES TRANSACTIONS DANS LE LOGICIEL. Le code de sauvegarde-chargement de configuration est le développement d'une idée originale de l'article "How to Load and Save Configurations on an Arduino" de Ragnar Ranyen Homb sur le site Norwegian Creation.*/#include "JXWG_Defs.h"#include "JXWG_Graphics .h"void setup() { // si vous utilisez un simple encodeur et des résistances pullup 3x10K, appliquez ces paramètres sous pinMode(PinA, INPUT); pinMode(PinB, INPUT); pinMode(PinS, INPUT); //si vous utilisez un simple encodeur sans résistances 3x10K, utilisez la prochaine ligne d'arbre //pinMode(PinA, INPUT_PULLUP); //pinMode(PinB, INPUT_PULLUP); //pinMode(PinS, INPUT_PULLUP); // LA PLUPART DES ENCODEURS SOUDÉS SUR PCB ONT DÉJÀ DES RÉSISTANCES DE PULLUP SUR LES BROCHES A ET B MAIS PAS SUR LA BROCHE DE COMMUTATEUR // alors utilisez les paramètres ci-dessous // pinMode (PinA, INPUT); //pinMode(PinB, INPUT); //pinMode(PinS, INPUT_PULLUP); digitalWrite (PinA, HAUT); digitalWrite (PinB, HAUT); digitalWrite (PinS, HAUT); pinMode (PinCoupling, SORTIE); //Coupling Mode Encoder.setDebounceDelay(5); display.begin(SH1106_SWITCHCAPVCC, 0x3C); //initialiser avec l'adresse I2C 0x3C (pour le 128x64) display.clearDisplay(); // display.setRotation(2); //décommentez cette ligne si vous voulez monter l'affichage à l'envers Wire.begin(); // rejoindre le bus i2c en tant que maître TWBR =5; // freq=615kHz period=1.625uS //Attribue l'événement de poussée du commutateur d'encodeur pour interrompre 1 broche 3 d'Arduino attachInterrupt (digitalPinToInterrupt (PinS), encoderSwitch, FALLING); DDS_Init(); //Initialisation du module DDS ; setConfig(); //Charger la configuration et définir les valeurs de démarrage} //---> end setup()void loop() { JX_WaveGenerator_MAIN();}//------------------- -------------------------------------------------- -------------------------------------------------- ------------------// Fonction PRINCIPALE JX WaveGenerator //----------------------- -------------------------------------------------- -------------------------------------------------- -------------void JX_WaveGenerator_MAIN() { octet encoderSpin =Encoder.rotate(); //Direction de rotation de l'encodeur 1=CW, 2=CCW byte encoderLongPush =Encoder.pushLong(1000); //codeur long événement push long lStep =0; //valeur de pas de fréquence actuelle long wTime =600000; //10 min si (encodeurPush) délai (250); if (encoderSpin) { cTime =millis(); } else { if (millis() - cTime> wTime) { ScreenSaver(); } } switch (mode) { case LOGARITHMIQUE ://0 //----------------------------------- -------------------------------------------------- ----------------------------------------------- // mode LOGARITHMIQUE :Fréquence de changement de rotation du codeur par pas logaritmique 1,10,100,1000,10000,100000 Hz //------------------------------ -------------------------------------------------- -------------------------------------------------- - if (encoderSpin) { if (lFreq>=1) { lStep =AutoStep(lFreq, encoderSpin); //Calculer le pas logaritmique } else if (_CouplingMode ==OFF) { //si le mode de couplage est défini sur OFF resetCouplingMode(); //définir le mode de couplage par défaut lorsque la fréquence n'est pas 0 encoderSpin =0; //saute le premier spin } if (encoderSpin ==CW &&lFreq <=999999 - lStep) { //spin CW incrémente la fréquence lFreq +=lStep; } if (encoderSpin ==CCW &&lFreq>=lStep + 1) { //spin CCW décrémente la fréquence lFreq -=lStep; } DDS_FrequencySet(lFreq, Wave[_WaveType]); //envoyer la valeur de fréquence au module DDS displayFrequency(lFreq); //envoyer la fréquence formatée pour afficher lLastFreq =lFreq; //enregistrer la fréquence actuelle } //------------------------------------------- -------------------------------------------------- ---------------------------------------------------- // mode de travail LOGARITHMIQUE :bouton poussoir de l'encodeur en mode OPTIONS //------------------------------------------------ -------------------------------------------------- --------------------------------- if (encoderPush) { encoderPush =false; //Effacer le drapeau push drawSymbol(1); //dessiner le symbole de la flèche selectIcon(0, WHITE); //dessine une bordure autour de la première icône idx =0; idy =0; //réinitialiser les pointeurs var mode =OPTIONS; //passer au mode OPTIONS } break; //fin mode LOGARITHMIQUE cas SINGLEDIGIT:///------------------------------------- -------------------------------------------------- ---------------------- // sous-mode SINGLEDIGIT :La rotation de l'encodeur déplace le curseur vers la gauche et la droite //-------------- -------------------------------------------------- ---------------------------------------------- si (encodeurSpin) { if (encoderSpin ==CW &&idx  0) idx--; //pointeur de diminution dans le sens inverse des aiguilles d'une montre //------------------------------------------- -------------------------------------------------- --------------- // lorsque idx est compris entre 0 et 5, sélectionnez les chiffres de fréquence //--------------------- -------------------------------------------------- ------------------------------------- if (idx>=0 &&idx =MAXDIGIT &&idx <=MAXDIGIT + 2) { //si la position actuelle est au-delà des chiffres hideCursor(MAXDIGIT - 1); //masquer le curseur au dernier chiffre drawSymbol(1); //dessiner la flèche dn selectIcon(idx - MAXDIGIT, WHITE); //sélectionner l'icône } } //------------------------------------------- -------------------------------------------------- ---------------------------------------- // sous-mode SINGLEDIGIT :événement push de l'encodeur //- -------------------------------------------------- -------------------------------------------------- ------------------------------ if (encoderPush) { encoderPush =false; //------------------------------------------------ -------------------------------------------------- ----------- // si un chiffre de 0 à 5 est sélectionné passer en mode DIGITCHANGE //---------------------- -------------------------------------------------- ------------------------------------- if (idx <=MAXDIGIT - 1) { hideCursor(idx ); // délai du curseur flash (250); //pour selectDigit(idx); //confirmation visuelle drawSymbol(2); //dessiner l'icône de tour mode =DIGITCHANGE; //changer de mode } //------------------------------------------- -------------------------------------------------- ---------------- // sinon il y a une icône sélectionnée puis allez dans OPTIONS //-------------------- -------------------------------------------------- ---------------------------------------------------- else { if (idx>=MAXDIGIT &&idx <=MAXDIGIT + 2) { idy =idx - MAXDIGIT; selectOption(idy); idy =options[idy]; } } } Pause; //fin du mode SINGLEDIGIT case SWEEP://2 //------------------------------------- -------------------------------------------------- ------------------------- // mode de travail SWEEP :rotation de l'encodeur déplace le curseur vers la gauche et la droite pour la sélection des options //-------- -------------------------------------------------- -------------------------------------------------- ---- if (encoderSpin) { if (encoderSpin ==CW &&idy <2) idy++; if (encoderSpin ==CCW &&idy> 0) idy--; selectIcon(idy, BLANC); } if (encodeurPush) { //------------------------------------------ -------------------------------------------------- ---------------------------------------------------- // mode de travail SWEEP :appuyez sur l'encodeur pour aller dans OPTIONS, OPTIONS DE BALAYAGE ou balayage START/STOP //----------------------------------------- -------------------------------------------------- ---------------------------------------- encoderPush =false; switch (idy) { case 0 :lFreq =atol(Freq); selectOption(idy); idy =options[idy]; retard (100); if (_WorkMode !=2) displayFrequency(lLastFreq); SweepReset(); Pause; cas 1 :lFréq =atol(Fréq); dessinerSymbole(9) ; dessinerSymbole(1) ; displaySweepIcons(); selectIcon(0, BLANC); idy =0; displayFrequency(_Sweep(idy)); retard (100); SweepReset(); mode =OPTSWEEP ; Pause; case 2 ://** sweepStatus :ENCORE 0 (jamais démarré), 1 BREAK, 2 PAUSE ** if (sweepStatus ==STILL || sweepStatus ==PAUSE) { drawSymbol(3); //dessiner l'icône de pause selectIcon(2, WHITE); //sélectionnez l'icône FrequencySweep(); //exécuter le balayage } else { //si en pause drawSymbol(4); //dessiner l'icône de lecture sweepStatus =PAUSE; } Pause; } } if (sweepStatus ==PAUSE) flashIcon(250); //clignotant pause texte break; //fin du mode SWEEP case OPTIONS://3 if (encoderLongPush) reset(); //------------------------------------------------ -------------------------------------------------- ---------------------------------- // OPTIONS de mode :option de sélection de rotation de l'encodeur à modifier (mode de travail, type d'onde, mode de couplage ) //------------------------------------------------------------ -------------------------------------------------- ---------------------------------- if (encoderSpin) { if (encoderSpin ==CW &&idy <2) idy++; if (encoderSpin ==CCW &&idy> 0) idy--; selectIcon(idy, BLANC); } //------------------------------------------------------------ -------------------------------------------------- ---------------------------------- // mode OPTIONS :Poussoir de l'encodeur en mode relatif //--- -------------------------------------------------- -------------------------------------------------- ---------------------------- if (encoderPush) { encoderPush =false; //selectIcon(idy, NOIR); selectOption(idy); masquerCurseur(0); idy =options[idy]; } Pause; //fin du mode OPTIONS case OPTMODE://4 //------------------------------------- -------------------------------------------------- -------------------------------------------- // mode OPTMODE :Encodeur icônes de mode de sélection de spin (logarithmique, à un chiffre, balayage) //------------------------------------- -------------------------------------------------- --------------------------------------------------------------------- si (encoderSpin) { si (encoderSpin ==CW &&idy <2) idy++; if (encoderSpin ==CCW &&idy> 0) idy--; selectIcon(idy, BLANC); } //------------------------------------------------------------ -------------------------------------------------- ---------------------------------- // mode OPTMODE:Encodeur push select workmode à définir (stocké dans l'option[ 0]) //----------------------------------------------------------- -------------------------------------------------- ------------------------------------ if (encoderPush) { encoderPush =false; octet pMode =_WorkMode; switch (idy) { case 0 :hideCursor(0); dessinerSymbole(0) ; lFréq =lDernièreFréq; displayFrequency(lFreq); _setWorkMode(LOGARITHMIQUE); Pause; cas 1 : drawSymbol(0) ; selectDigit(0) ; lFréq =lDernièreFréq; displayFrequency(lFreq); _setWorkMode(SINGLEIGIT); Pause; cas 2 :lLastFreq =lFreq; displayFrequency(_SweepMin); //prêt à démarrer _setWorkMode(SWEEP); Pause; } mode =_WorkMode; if (pMode !=_WorkMode) saveConfig(); if (_CouplingMode ==OFF) resetCouplingMode(); idx =0 ; drawAllIcons(); } Pause; //fin du mode OPTMODE cas OPTWAVE://5 //------------------------------------- -------------------------------------------------- ------------------------- // mode OPTWAVE :La rotation de l'encodeur déplace le curseur vers la gauche et la droite pour la sélection d'onde (sqr, sin, tri) //- -------------------------------------------------- -------------------------------------------------- ----------- if (encoderSpin) { if (encoderSpin ==CW &&idy <2) idy++; if (encoderSpin ==CCW &&idy> 0) idy--; selectIcon(idy, BLANC); } //------------------------------------------------------------ -------------------------------------------------- ------------------- // mode OPTWAVE :Encodeur push set nouveau type d'onde //------------------ -------------------------------------------------- ------------------------------------------------ si ( encoderPush) { encoderPush =false; if (_WaveType !=idy) { _setWaveType(idy); saveConfig(); } Fréquence de mise à jour(); // met à jour le type d'onde drawAllIcons(); idx =0 ; mode =_WorkMode; } Pause; //fin du mode OPTWAVE case OPTCOUP://6 //------------------------------------- -------------------------------------------------- ------------------------- // mode OPTCOUP :La rotation de l'encodeur déplace le curseur vers la gauche et la droite pour la sélection du mode de couplage //------- -------------------------------------------------- -------------------------------------------------- ----- if (encoderSpin) { if (encoderSpin ==CW &&idy <2) idy++; if (encoderSpin ==CCW &&idy> 0) idy--; selectIcon(idy, BLANC); } //------------------------------------------------------------ -------------------------------------------------- ------------------- // mode OPTCOUP :Encodeur push sélection du mode de couplage courant //------------------ -------------------------------------------------- ------------------------------------------------ si ( encoderPush) { encoderPush =false; setCouplingMode(idy); drawAllIcons(); idx =0 ; mode =_WorkMode; } Pause; //fin du mode OPTCOUP cas OPTSWEEP://7 //------------------------------------- -------------------------------------------------- ----------------------------- // mode OPTSWEEP :rotation de l'encodeur sélectionne les valeurs de balayage à éditer //------- -------------------------------------------------- -------------------------------------------------- --------- if (encoderSpin) { if (encoderSpin ==CW &&idy <2) idy++; //augmentation du pointeur dans le sens horaire if (encoderSpin ==CCW &&idy> 0) idy--; //pointeur de diminution dans le sens inverse des aiguilles d'une montre selectIcon(idy, WHITE); //sélectionnez la première icône displayFrequency(_Sweep(idy)); //afficher la valeur de balayage actuelle } if (encoderPush) { encoderPush =false; //------------------------------------------------ -------------------------------------------------- ------------------ // mode OPTSWEEP :Encodeur push confirmer les valeurs de balayage à éditer //------------------ -------------------------------------------------- ------------------------------------------------ dessinerSymbole( 0); selectDigit(0) ; selectIcon(idy, BLANC); idx =0 ; displayFrequency(_Sweep(idy)); mode =SWEEPEDIT ; } Pause; //fin du mode OPTSWEEP cas SWEEPEDIT://8 //------------------------------------- -------------------------------------------------- ----------------------- // mode SWEEPEDIT :rotation de l'encodeur sélectionner le chiffre à modifier //-------------- -------------------------------------------------- ----------------------------------------------- si (encodeurSpin) { if (encoderSpin ==CW &&idx  0) idx--; //pointeur de diminution dans le sens inverse des aiguilles d'une montre selectDigit(idx); } //------------------------------------------------------------ -------------------------------------------------- ------------- // mode SWEEPEDIT :Encodeur à pression longue sortie de l'édition et retour à SWEEP //--------------------- -------------------------------------------------- ---------------------------------------------------- if (encoderLongPush ==LONGPUSH) { encoderPush =false; drawAllIcons(); displayFrequency(_SweepMin); hideCurseur(idx); _setWorkMode(BALAYAGE); SweepReset(); mode =_WorkMode; retard (250); } if (encoderPush) { encoderPush =false; //------------------------------------------------ -------------------------------------------------- ----------- // mode SWEEPEDIT :Encodeur pousser aller au mode DIGITCHANGE //-------------------------- -------------------------------------------------- --------------------------------- hideCursor(idx); // délai du curseur flash (250); //pour selectDigit(idx); //confirmation visuelle drawSymbol(2); //dessiner l'icône de tour mode =DIGITCHANGE; //changer de mode } break;//fin de mode SWEEPEDIT case DIGITCHANGE://9 //------------------------------ -------------------------------------------------- ------------------------- // mode DIGITCHANGE :Encodeur à pression longue sortie de DIGITCHANGE en mode SWEEP //--------- -------------------------------------------------- ----------------------------------------------- si (encodeurLongPush ==LONGPUSH &&_WorkMode ==SWEEP) { encoderPush =false; hideCurseur(idx); dessinerSymbole(1) ; mode =OPTSWEEP ; retard (250); } //------------------------------------------------------------ -------------------------------------------------- -------- // mode DIGITCHANGE :La rotation de l'encodeur change la valeur du chiffre (0 -> 9 ->0 et ainsi de suite) //------------------ -------------------------------------------------- ------------------------------------- if (encoderSpin) { //rotation de l'encodeur if (encoderSpin ==CW) { //sens horaire Freq[idx]++; si (Fréq[idx]> '9') Freq[idx] ='0' ; } else { //sens antihoraire Freq[idx]--; si (Fréq[idx] <'0') Freq[idx] ='9'; } updateDigit(idx, Freq[idx]); //mettre à jour le chiffre affiché } //------------------------------------------ -------------------------------------------------- -------------- // mode DIGITCHANGE :Encodeur push retour au mode SINGLEDIGIT ou SWEEPEDIT //--------------------- -------------------------------------------------- ---------------------------------- if (encoderPush) { // flag push de l'encodeur défini par l'interruption encoderPush =false; //réinitialiser l'indicateur d'événement hideCursor(idx); // délai du curseur flash (250); //pour selectDigit(idx); //confirmation visuelle drawSymbol(0); if (_WorkMode ==SWEEP) { long ltemp =_Sweep(idy); //enregistrer la valeur _setSweep(idy, atol(Freq)); //convertit la nouvelle valeur du tableau en long if (_SweepMax> 0 &&_SweepMax> _SweepMin &&_SweepStep>
 0) { //vérifie la congruence de la nouvelle valeur de balayage if (_Sweep(idy) !=ltemp) saveConfig(); //si la valeur a changé, écrivez une nouvelle valeur dans l'EEPROM displayFrequency(_Sweep(idy)); mode =SWEEPEDIT ; //changer de mode } else { _displayErrMsg; // afficher le message d'erreur stocké dans le délai de mémoire flash (1000); _setSweep(idy, ltemp); //restauration de la valeur enregistrée displayFrequency(_Sweep(idy)); //réafficher la valeur drawSymbol(2) ; //redessiner l'icône de virage } } else { //si pas en mode balayage if (_CouplingMode ==OFF) { //si mode couplage si OFF lLastFreq =atol(Freq); //enregistrer la fréquence actuelle resetCouplingMode(); //définir le mode de couplage par défaut } UpdateFrequency(); //envoyer la fréquence au module DDS mode =SINGLEDIGIT; //changer de mode } } break; //fin du mode DIGITCHANGE par défaut :break ; }}//---------------------------------------------- -------------------------------------------------- -----------------------------------// Evénement de l'encodeur Push - Appelé par interruption//---- -------------------------------------------------- -------------------------------------------------- ------------------------------------------void encoderSwitch(void) { encoderPush =true;}//---------- -------------------------------------------------- -------------------------------------------------- ---------------------// Fonctions utilitaires//----------------------- -------------------------------------------------- -------------------------------------------------- --------// Dessiner l'interface graphique//----------------------------------- -------------------------------------------------- ----------------------------void drawInterface() { display.clearDisplay(); display.display(); retard(1000); display.drawRoundRect(0, 0, 128, 64, 3, BLANC); //dessiner le cadre externe display.fillRect(1, 1, 126, 14, WHITE); //draw caption frame displayText(12, 4, strFromFlash(0), BLACK, WHITE, SMALL); //print caption title delay(1000); if (cTime ==1) { //only on power on displayText(XPOS - 6, YPOS + 10, strFromFlash(1), WHITE, BLACK, BIG); //show Welcom message delay(1000); display.fillRect(2, 16, display.width() - 3, 35, BLACK); //clear Welcome message cTime =0; } display.display(); displayText(XPOS + 84, YPOS + 4, strFromFlash(2), WHITE, BLACK, SMALL); //print "Hz" sprintf(Freq, "%06li", lFreq); //put frequency value into char array with template "000000" for (int i =MAXDIGIT - 1; i>=0; i--) { display.drawChar(XPOS + 2 + i * DELTAX, YPOS, Freq[i] , WHITE, BLACK, BIG); //Display with animation effect from right to left display.display(); }}//end drawInterface()//----------------------------------------------------------------------------------------------------------------// Print string in x,y pos with specified colors and size//----------------------------------------------------------------------------------------------------------------void displayText(byte x, byte y, const char *str, byte foreColor, byte backColor, byte textSize) { display.setTextSize(textSize); //textsize:SMALL or BIG global const display.setTextColor(foreColor, backColor); //colors WHITE or BLACK global const of the library display.setCursor(x, y); //set the cursor position display.print(str); //str is the pointer to the string of chars display.display(); //update display}//----------------------------------------------------------------------------------------------------------------// Copies element [i] of the string_table array from flash memory to the ram buffer and returns the pointer to the buffer//----------------------------------------------------------------------------------------------------------------char* strFromFlash(byte i) { strcpy_P(buffer, (char*)pgm_read_word(&(string_table[i]))); return (char*)buffer;}//----------------------------------------------------------------------------------------------------------------// Draw or clear a border around selected icon after clearing border of the previous one//----------------------------------------------------------------------------------------------------------------void selectIcon(byte icon, byte color) { static byte prevIcon; display.drawRect(XPOS - 10 + prevIcon * 32, YPOS + 19, 29, 20, BLACK); display.drawRect(XPOS - 10 + icon * 32, YPOS + 19, 29, 20, color); display.display(); prevIcon =icon;}//----------------------------------------------------------------------------------------------------------------// Display all workmode icons//----------------------------------------------------------------------------------------------------------------void displayWorkModeIcons(void) { byte const *bitmap[3] ={imgLog, imgDigit, imgSweep}; _clearIconsArea; for (byte i =0; i <=2; i++) { display.drawBitmap(XPOS - 8 + i * 32, YPOS + 21, bitmap[i], 25, 16, WHITE); } display.display();}//----------------------------------------------------------------------------------------------------------------// Display all wavetype icons//----------------------------------------------------------------------------------------------------------------void displayWaveTypeIcons(void) { byte const *bitmap[3] ={imgSqr, imgSin, imgTri}; _clearIconsArea; for (byte i =0; i <=2; i++) { display.drawBitmap(XPOS - 8 + i * 32, YPOS + 21, bitmap[i], 25, 16, WHITE); } display.display();}//----------------------------------------------------------------------------------------------------------------// Display all coupling mode icons//----------------------------------------------------------------------------------------------------------------void displayCouplingModeIcons(void) { byte const *bitmap[3] ={imgCoAc, imgCoDc, imgCoOff}; _clearIconsArea; for (byte i =0; i <=2; i++) { display.drawBitmap(XPOS - 8 + i * 32, YPOS + 21, bitmap[i], 25, 16, WHITE); } display.display();}//----------------------------------------------------------------------------------------------------------------// Display all sweep icons//----------------------------------------------------------------------------------------------------------------void displaySweepIcons(void) { byte const *bitmap[3] ={imgSwMax, imgSwMin, imgSwStep}; _clearIconsArea; for (byte i =0; i <=2; i++) { display.drawBitmap(XPOS - 8 + i * 32, YPOS + 21, bitmap[i], 25, 16, WHITE); } display.display();}//----------------------------------------------------------------------------------------------------------------// Draw all icons//----------------------------------------------------------------------------------------------------------------void drawAllIcons(void) { _clearIconsArea; drawModeIcon(); if (_WorkMode ==SWEEP || _WorkMode ==SWEEPEDIT ) { display.drawBitmap(XPOS + 24, YPOS + 21, imgSwOpt, 25, 16, WHITE); display.drawBitmap(XPOS + 56, YPOS + 21, imgSwStart, 25, 16, WHITE); drawSymbol(1); idy =2; selectIcon(idy, WHITE); //ready to sweep drawSmallWaveIcon(); drawSmallCouplingIcon(); } else { drawWaveIcon(); drawCouplingIcon(); drawSymbol(0); if (_WorkMode ==SINGLEDIGIT) selectDigit(0); } display.display();}//----------------------------------------------------------------------------------------------------------------// Draws the icon based on the value of relative option//----------------------------------------------------------------------------------------------------------------void drawModeIcon(void) { byte x =XPOS - 8, y =YPOS + 21; byte const *bitmap[3] ={imgLog, imgDigit, imgSweep}; display.fillRect(x, y, 25, 16, BLACK); display.drawBitmap(x, y, bitmap[_WorkMode], 25, 16, WHITE); display.display();}void drawWaveIcon(void) { byte x =XPOS + 24, y =YPOS + 21; const byte *bitmap[3] ={imgSqr, imgSin, imgTri}; display.fillRect(x, y, 25, 16, BLACK); display.drawBitmap(x, y, bitmap[_WaveType], 25, 16, WHITE); display.display(); drawSmallWaveIcon();}void drawCouplingIcon(void) { byte x =XPOS + 56, y =YPOS + 21; const byte *bitmap[3] ={imgCoAc, imgCoDc, imgCoOff}; display.fillRect(x, y, 25, 16, BLACK); display.drawBitmap(x, y, bitmap[_CouplingMode], 25, 16, WHITE); display.display(); drawSmallCouplingIcon();}//----------------------------------------------------------------------------------------------------------------// Draws small wave icon based on the value of relative option//----------------------------------------------------------------------------------------------------------------void drawSmallWaveIcon(void) { byte x =114, y =41; const byte *bitmap[3] ={imgSqrSmall, imgSinSmall, imgTriSmall}; display.fillRect(x, y, 9, 8, BLACK); display.drawBitmap(x, y, bitmap[_WaveType], 9, 8, WHITE); display.display();}//----------------------------------------------------------------------------------------------------------------// Draws small coupling icon based on the value of relative option//----------------------------------------------------------------------------------------------------------------void drawSmallCouplingIcon(void) { byte x =114, y =50; const byte *bitmap[3] ={imgAcSmall, imgDcSmall, imgOffSmall}; display.fillRect(x, y, 9, 8, BLACK); display.drawBitmap(x, y, bitmap[_CouplingMode], 9, 8, WHITE); display.display();}//----------------------------------------------------------------------------------------------------------------// Show cursor at x position//----------------------------------------------------------------------------------------------------------------void showCursor(byte x) { display.drawChar(XPOS + 2 + x * DELTAX, YPOS + DELTAY, CURSOR, WHITE, WHITE, BIG); display.display();}//----------------------------------------------------------------------------------------------------------------// Hide cursor at x position//----------------------------------------------------------------------------------------------------------------void hideCursor(byte x) { display.drawChar(XPOS + 2 + x * DELTAX, YPOS + DELTAY, CURSOR, BLACK, BLACK, BIG); display.display();}//----------------------------------------------------------------------------------------------------------------// Show cursor at x position after hiding previous one//----------------------------------------------------------------------------------------------------------------void selectDigit(byte x) { static byte lastDigit; hideCursor(lastDigit); display.drawChar(XPOS + 2 + x * DELTAX, YPOS + DELTAY, CURSOR, WHITE, WHITE, BIG); display.display(); lastDigit =x;}//----------------------------------------------------------------------------------------------------------------// Update single digit frequency to chr value//----------------------------------------------------------------------------------------------------------------void updateDigit(byte digit, char chr) { display.drawChar(XPOS + 2 + digit * DELTAX, YPOS, chr , WHITE, BLACK, BIG); display.display();}//----------------------------------------------------------------------------------------------------------------// Drwaw or clear some symbols/icons//----------------------------------------------------------------------------------------------------------------void drawSymbol(byte symbol) { switch (symbol) { case 0://Top arrow display.fillRect(2, 20, 25, 16, BLACK); display.fillRect(2, 43, 14, 16, BLACK); display.drawChar(XPOS - 20 , YPOS + 4, ARROW, WHITE, BLACK, SMALL); //draw top arrow top break; case 1://Bottom arrow display.fillRect(2, 20, 25, 16, BLACK); display.fillRect(2, 43, 14, 16, BLACK); display.drawChar(XPOS - 20 , YPOS + 25, ARROW, WHITE, BLACK, SMALL); //draw bottom arrow break; case 2://Turn icon display.fillRect(2, 20, 25, 16, BLACK); display.drawBitmap(XPOS - 21, YPOS + 1, imgTurn, 13, 13, WHITE); //draw turn icon break; case 3://Play icons display.fillRect(4, 23, 23, 11, BLACK); //clear pause icon display.drawBitmap(4, 23, imgSwRun, 23, 11, WHITE); //draw sweep icon display.fillRect(XPOS + 56, YPOS + 21, 25, 16, BLACK); //clear icon area display.drawBitmap(XPOS + 56, YPOS + 21, imgSwPause, 25, 16, WHITE); //drwaw sweep play symbol icon break; case 4://Pause icons display.fillRect(4, 23, 23, 11, BLACK); //clear sweep icon display.drawBitmap(4, 23, imgSwPsd, 23, 11, WHITE); //draw pause icon display.fillRect(XPOS + 56, YPOS + 21, 25, 16, BLACK); //clear icon area display.drawBitmap(XPOS + 56, YPOS + 21, imgSwStart, 25, 16, WHITE); //draw sweep pause symbol icon break; case 9://Simply clear symbol area display.fillRect(2, 20, 25, 16, BLACK); //clear top symbol area display.fillRect(2, 43, 14, 16, BLACK); //clear bottom symbol area break; default:break; } display.display();}//---------------------------------------------------------------------------------------------------------------// Set current frequency in DDS module, if frequency is 0 it will be set to 1//---------------------------------------------------------------------------------------------------------------void UpdateFrequency(void) { lFreq =atol(Freq); //convert char array to long if (lFreq <1) { //the frequency at zero makes no sense ++Freq[MAXDIGIT - 1]; //increase the right most digit lFreq =1; //set frequency to 1 } displayFrequency(lFreq); //update the display DDS_FrequencySet(lFreq, Wave[_WaveType]); //send the frequency value to DDS module lLastFreq =lFreq; //save current freq}//---------------------------------------------------------------------------------------------------------------// Display the frequency with the six-zero template//---------------------------------------------------------------------------------------------------------------void displayFrequency(long f) { sprintf(Freq, "%06li", f); //convert long to char with template '000000' displayText(XPOS + 2, YPOS, Freq , WHITE, BLACK, BIG); //print frequency on display display.display(); //refresh display}//---------------------------------------------------------------------------------------------------------------// Reset coupling mode to default//---------------------------------------------------------------------------------------------------------------void resetCouplingMode(void) { if (lFreq ==0 &&_CouplingMode ==OFF) { setCouplingMode(AC); drawCouplingIcon(); }}//---------------------------------------------------------------------------------------------------------------// Set a specific coupling mode//---------------------------------------------------------------------------------------------------------------void setCouplingMode(byte cMode) { byte pMode =_CouplingMode; switch (cMode) { case 0:if (lLastFreq> 0) lFreq =lLastFreq; digitalWrite(PinCoupling, LOW); _setCouplingMode(AC); Pause; case 1:if (lLastFreq> 0) lFreq =lLastFreq; digitalWrite(PinCoupling, HIGH); _setCouplingMode(DC); Pause; case 2:lLastFreq =lFreq; lFreq =0; digitalWrite(PinCoupling, LOW); _setCouplingMode(OFF); Pause; } DDS_FrequencySet(lFreq, Wave[_WaveType]); displayFrequency(lFreq); if (cMode !=pMode) saveConfig();}//---------------------------------------------------------------------------------------------------------------// Select options//---------------------------------------------------------------------------------------------------------------void selectOption(byte opt) { selectIcon(opt, BLACK); switch (opt) { case 0://workMode; displayWorkModeIcons(); selectIcon(_WorkMode, WHITE); mode =OPTMODE; Pause; case 1://waveType; displayWaveTypeIcons(); selectIcon(_WaveType, WHITE); mode =OPTWAVE; Pause; case 2://couplingMode; displayCouplingModeIcons(); selectIcon(_CouplingMode, WHITE); mode =OPTCOUP; Pause; }}//----------------------------------------------------------------------------------------------------------------// Calculate logarithmic steps of the frequency//----------------------------------------------------------------------------------------------------------------long AutoStep(long value, byte spin) { if (spin ==CW) { if (value>=100000) return 100000; if (value>=10000) return 10000; if (value>=1000) return 1000; if (value>=100) return 100; if (value>=10) return 10; if (value>=1) return 1; return 0; // Invalid value } else { if (value <=10) return 1; if (value <=100) return 10; if (value <=1000) return 100; if (value <=10000) return 1000; if (value <=100000) return 10000; if (value <=1000000) return 100000; return 0; // Invalid value }}//-------------------------------------------------------------------------------------------// Start Sweep or restart it from where it came from before the pause//-------------------------------------------------------------------------------------------void FrequencySweep() { do { if (sweepDnPausedVal ==0) { //if sweepDown has not been stopped if (sweepUpPausedVal> 0) { //and sweepUp has been stopped sweepUpPausedVal =SweepUp(sweepUpPausedVal); //continues from current value } else { sweepUpPausedVal =SweepUp(_SweepMin); //else start from min } } if (sweepStatus !=BREAK) { //if sweep has been stopped if (sweepDnPausedVal> 0) { //and sweepDn has been stopped sweepDnPausedVal =SweepDn(sweepDnPausedVal); //continues from current value } else { sweepDnPausedVal =SweepDn(_SweepMax); //else start from max } } } while (sweepStatus !=BREAK); //continues sweep until stopped}//-----------------------------------------------------------------------------------------// Sweep Up from sweepmin push encoder to pause//-----------------------------------------------------------------------------------------long SweepUp(long sweepmin) { long f; for (f =sweepmin; f <_SweepMax; f +=_SweepStep) { DDS_FrequencySet(f, Wave[_WaveType]); displayFrequency(f); if (encoderPush) { sweepStatus =BREAK; Pause; } } if (sweepStatus ==BREAK) return f; return 0;}//-----------------------------------------------------------------------------------------// Sweep down from sweepmax push encoder to pause//-----------------------------------------------------------------------------------------long SweepDn(long sweepmax) { long f; for (f =sweepmax; f> _SweepMin; f -=_SweepStep) { DDS_FrequencySet(f, Wave[_WaveType]); displayFrequency(f); if (encoderPush) { sweepStatus =BREAK; Pause; } } if (sweepStatus ==BREAK)return f; return 0;}//-----------------------------------------------------------------------------------------// Clear global sweep vars and restore display//-----------------------------------------------------------------------------------------void SweepReset(void) { sweepStatus =STILL; sweepUpPausedVal =0; sweepDnPausedVal =0; display.fillRect(4, 23, 23, 11, BLACK); //clear sweep text display.display();}//-----------------------------------------------------------------------------------------// Flash sweep pause icon//-----------------------------------------------------------------------------------------void flashIcon(int interval) { static long previousMillis; static boolean picShow; if (millis() - previousMillis>=interval) { previousMillis =millis(); picShow =!picShow; if (picShow) { display.drawBitmap(4, 23, imgSwPsd, 23, 11, WHITE); //drwaw sweep pause icon display.display(); } else { display.fillRect(4, 23, 23, 11, BLACK); //clear sweep pause icon display.display(); } }}//-----------------------------------------------------------------------------------------// Arduino software reset//-----------------------------------------------------------------------------------------void reset(void) { display.fillRect(1, 16, 125, 46, BLACK); display.display(); displayText(30, 30, strFromFlash(4), WHITE, BLACK, BIG); char str[2]; for (byte i =3; i> 0; i--) { sprintf(str, "%d", i); displayText(95, 30, str, WHITE, BLACK, BIG);...This file has been truncated, please download it to see its full contents.
JXWG_Defs.hC/C++
Declarections section
// This file is an integral part of the JX_WaveGenerator.ino and must be// distributed together with the main file to allow it to function correctly.// The same license of the main file applies to this file.// Janux 01/04/2021 on Turin, Italy.#ifndef JXWG_Defs#define JXWG_Defs#include #include //Encoder library, see https://www.arduino.cc/reference/en/libraries/simplerotary/#include  // //adaptation of the library for SSD1306 to the SH1106 display, see https://github.com/wonho-maker/Adafruit_SH1106#include #define DEBUG 0#define OLED_RESET -1Adafruit_SH1106 display(OLED_RESET);#define PinA 5 //Encoder pin A#define PinB 4 //Encoder pin B #define PinS 3 //Encoder pin SwitchSimpleRotary Encoder(PinA, PinB, PinS);//list of loop mode#define LOGARITHMIC 0 //+workmode#define SINGLEDIGIT 1 //+workmode#define SWEEP 2 //+workmode#define OPTIONS 3 //-submode of LOGARITHMIC and SINGLEDIGIT#define OPTMODE 4 //-submode of OPTIONS#define OPTWAVE 5 //-submode of OPTIONS#define OPTCOUP 6 //-submode of OPTIONS#define OPTSWEEP 7 //-submode of SWEEP#define SWEEPEDIT 8 //-submode of OPTSWEEP#define DIGITCHANGE 9 //-submode of SINGLEDIGIT and SWEEPEDIT#define PinCoupling 7 //Coupling mode pin (relay pin)//constants #define XPOS 28#define YPOS 21#define DELTAX 12#define DELTAY 4#define SMALL 1#define BIG 2#define CW 1#define CCW 2#define PUSH 1#define LONGPUSH 1//Num Freq digit#define MAXDIGIT 6//Wave type#define SQUARE 0#define SINE 1#define TRIANGLE 2//Coupling mode#define AC 0#define DC 1#define OFF 2//Sweep status#define STILL 0#define BREAK 1#define PAUSE 2//Symbols chars#define CURSOR 0x5F#define ARROW 0x10//AD9833 module Pin connection#define DDS_FSY 9#define DDS_CLK 10#define DDS_DAT 11//AD9833 Wave Type const#define wSquare 0x28#define wSine 0x00#define wTriangle 0x02//-----------------------------------------------------------------------------// Variables declarections //-----------------------------------------------------------------------------//Strings constants placed in flash memory save ram spaceconst char str1[] PROGMEM ="JX WAVE GENERATOR"; // 18 byteconst char str2[] PROGMEM ="WELCOME"; // 8 byteconst char str3[] PROGMEM ="Hz"; // 3 byteconst char str4[] PROGMEM ="ERROR!"; // 7 byteconst char str5[] PROGMEM ="RESET"; // 6 byte //42 byte totalconst char* const string_table[] PROGMEM ={str1, str2, str3, str4, str5};char buffer[18]; //local buffer for string, make sure this is large enough for the largest string it must holdlong lFreq =1000; //main frequency variablelong lLastFreq =1000; //used to save the current freq value in some situationslong sweepUpPausedVal =0; //value of sweep when pusedlong sweepDnPausedVal =0; //value of sweep when pusedlong lSweep[3] ={20000, 0, 100}; //Sweep Hz default value MAX, MIN, STEP;byte sweepStatus =STILL; //current status of the sweep processconst byte Wave[] ={wSquare, wSine, wTriangle}; //array for WaveTypevolatile boolean encoderPush =false; //var used in the routine called by interruptchar Freq[MAXDIGIT + 1]; //array for display frequency in 6 digit template "000000"byte mode =0; //current loop modebyte idx =0; //pointer to digit index (0 to 5)byte idy =0; //same of idx in submodelong cTime =1; //screensaver counter//default startup preferencesbyte options[3] ={LOGARITHMIC, SINE, DC}; //mode, wavetype, couplingmode//define others macros#define _WorkMode options[0]#define _setWorkMode(x) options[0]=x#define _WaveType options[1]#define _setWaveType(x) options[1]=x#define _CouplingMode options[2]#define _setCouplingMode(x) options[2]=x#define _reservedbyte 0xFF#define _SweepMax lSweep[0]#define _SweepMin lSweep[1]#define _SweepStep lSweep[2]#define _Sweep(x) lSweep[x]#define _setSweep(x,f) lSweep[x]=f#define _setSweepMax(x) lSweep[0]=x#define _setSweepMin(x) lSweep[1]=x#define _setSweepStep(x) lSweep[2]=x//define short functions macros#define _clearIconsArea display.fillRect(XPOS - 11, YPOS + 18, 94, 24, BLACK)#define _displayErrMsg displayText(XPOS + 2, YPOS, strFromFlash(3), WHITE, BLACK, BIG);//define CONFIG consts &vars #define CONFIG_START 32 //EEPROM Memory start location#define CONFIG_VERSION "JXWG1" //Config version ID//define custom type structtypedef struct { char version[6]; byte workmode; byte wavetype; byte couplingmode; byte reservedbyte; long sweepmax; long sweepmin; long sweepstep;} config_type;//create new struct and load it with default valueconfig_type CONFIG ={ CONFIG_VERSION, _WorkMode, _WaveType, _CouplingMode, _reservedbyte, _SweepMax, _SweepMin, _SweepStep,};//define processor reset functionvoid(*ATmegaReset)(void) =0;#endif
JXWG_Graphics.hC/C++
Icon resource data file
// This file is an integral part of the JX_WaveGenerator.ino and must be// distributed together with the main file to allow it to function correctly.// The same license of the main file applies to this file.// Janux 01/04/2021 on Turin, Italy.#ifndef JXWG_Graphics#define JXWG_Graphics//----------------------------------------------------------------------------------------------// Plain b&w bitmaps PROGMEM icons data//----------------------------------------------------------------------------------------------const byte imgLog[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x88, 0x00, 0x40, 0x80, 0x9c, 0x00, 0x40, 0x80, 0x88, 0x00, 0x80, 0x80, 0x88, 0x00, 0x80, 0x80, 0x88, 0x01, 0x00, 0x80, 0x88, 0x02, 0x00, 0x80, 0x88, 0x0c, 0x00, 0x80, 0x88, 0x30, 0x00, 0x80, 0x89, 0xc0, 0x00, 0x80, 0x8e, 0x00, 0x10, 0x80, 0x9f, 0xff, 0xf8, 0x80, 0x88, 0x00, 0x10, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgDigit[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x9c, 0x47, 0x3e, 0x80, 0xa2, 0xc8, 0x82, 0x80, 0xa6, 0x40, 0x84, 0x80, 0xaa, 0x47, 0x0c, 0x80, 0xb2, 0x48, 0x02, 0x80, 0xa2, 0x48, 0x22, 0x80, 0x9c, 0xef, 0x9c, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x3e, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSweep[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x8f, 0xcf, 0x38, 0x80, 0x88, 0x49, 0x28, 0x80, 0x88, 0x49, 0x28, 0x80, 0x88, 0x49, 0x28, 0x80, 0x88, 0x49, 0x28, 0x80, 0x88, 0x49, 0x28, 0x80, 0x88, 0x49, 0x28, 0x80, 0x88, 0x49, 0x28, 0x80, 0x88, 0x49, 0x28, 0x80, 0x88, 0x49, 0x28, 0x80, 0xb8, 0x79, 0xee, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSqr[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x82, 0x08, 0x20, 0x80, 0x80, 0xff, 0x80, 0x80, 0x82, 0x88, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x82, 0x88, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, 0xaa, 0xaa, 0xaa, 0x80, 0x80, 0x80, 0x80, 0x80, 0x82, 0x88, 0xa0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x82, 0x88, 0xa0, 0x80, 0xff, 0x80, 0xff, 0x80, 0x82, 0x08, 0x20, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSin[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x82, 0x08, 0x20, 0x80, 0x80, 0x1c, 0x00, 0x80, 0x82, 0x2a, 0x20, 0x80, 0x80, 0x41, 0x00, 0x80, 0x82, 0x49, 0x20, 0x80, 0x80, 0x80, 0x80, 0x80, 0xaa, 0xaa, 0xaa, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc3, 0x08, 0x61, 0x80, 0xc1, 0x00, 0x41, 0x80, 0xa2, 0x08, 0x22, 0x80, 0x9c, 0x00, 0x1c, 0x80, 0x82, 0x08, 0x20, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgTri[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x82, 0x08, 0x20, 0x80, 0x82, 0x00, 0x20, 0x80, 0x87, 0x08, 0x70, 0x80, 0x85, 0x00, 0x50, 0x80, 0x8a, 0x88, 0xa8, 0x80, 0x88, 0x80, 0x88, 0x80, 0xba, 0xeb, 0xae, 0x80, 0x90, 0x41, 0x04, 0x80, 0xa2, 0x2a, 0x22, 0x80, 0xa0, 0x22, 0x02, 0x80, 0xc2, 0x1c, 0x21, 0x80, 0xc0, 0x14, 0x01, 0x80, 0x82, 0x08, 0x20, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgCoAc[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x9c, 0x70, 0x00, 0x80, 0xa2, 0x88, 0x00, 0x80, 0xa2, 0x80, 0xc0, 0x80, 0xa2, 0x81, 0x24, 0x80, 0xbe, 0x81, 0x24, 0x80, 0xa2, 0x88, 0x18, 0x80, 0xa2, 0x70, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgCoDc[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xbc, 0x70, 0x00, 0x80, 0xa2, 0x88, 0x00, 0x80, 0xa2, 0x81, 0x54, 0x80, 0xa2, 0x80, 0x00, 0x80, 0xa2, 0x81, 0xfc, 0x80, 0xa2, 0x88, 0x00, 0x80, 0xbc, 0x70, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgCoOff[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x9c, 0xf7, 0x80, 0x80, 0xa2, 0x84, 0x22, 0x80, 0xa2, 0x84, 0x14, 0x80, 0xa2, 0xe7, 0x08, 0x80, 0xa2, 0x84, 0x14, 0x80, 0xa2, 0x84, 0x22, 0x80, 0x9c, 0x84, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSwMax[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x81, 0x00, 0x00, 0x80, 0x82, 0x00, 0x00, 0x80, 0x87, 0x01, 0x00, 0x80, 0x82, 0x03, 0x80, 0x80, 0x82, 0x07, 0xc0, 0x80, 0x82, 0x0f, 0xe0, 0x80, 0x82, 0x1f, 0xf0, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSwMin[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x81, 0x00, 0x00, 0x80, 0x82, 0x00, 0x00, 0x80, 0x87, 0x1f, 0xf0, 0x80, 0x82, 0x0f, 0xe0, 0x80, 0x82, 0x07, 0xc0, 0x80, 0x82, 0x03, 0x80, 0x80, 0x82, 0x01, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSwOpt[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x84, 0x08, 0x10, 0x80, 0x88, 0x1c, 0x38, 0x80, 0x9c, 0x3e, 0x10, 0x80, 0x88, 0x00, 0x00, 0x80, 0x88, 0x00, 0x00, 0x80, 0x88, 0x3e, 0x00, 0x80, 0x88, 0x1c, 0x38, 0x80, 0x88, 0x08, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSwStep[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x84, 0x08, 0x04, 0x80, 0x88, 0x0c, 0x08, 0x80, 0x9c, 0x7e, 0x1c, 0x80, 0x88, 0x7f, 0x08, 0x80, 0x88, 0x7e, 0x08, 0x80, 0x88, 0x0c, 0x08, 0x80, 0x88, 0x08, 0x08, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSwStart[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0xc0, 0x00, 0x80, 0x80, 0xf0, 0x00, 0x80, 0x80, 0xfc, 0x00, 0x80, 0x80, 0xff, 0x00, 0x80, 0x80, 0xff, 0xc0, 0x80, 0x80, 0xff, 0xc0, 0x80, 0x80, 0xff, 0x00, 0x80, 0x80, 0xfc, 0x00, 0x80, 0x80, 0xf0, 0x00, 0x80, 0x80, 0xc0, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgSwPause[] PROGMEM ={ 0xff, 0xff, 0xff, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x81, 0xe3, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x80};const byte imgTurn[] PROGMEM ={ 0x0f, 0x80, 0x30, 0x60, 0x47, 0x10, 0x58, 0xd0, 0x90, 0x48, 0x80, 0xe8, 0x90, 0x48, 0xb8, 0x08, 0x90, 0x48, 0x58, 0xd0, 0x47, 0x10, 0x30, 0x60, 0x0f, 0x80};const byte imgSwRun[] PROGMEM ={ 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x9b, 0xa2, 0x22, 0x6b, 0xae, 0xec, 0x7b, 0xae, 0xec, 0x9a, 0xa6, 0x62, 0xea, 0xae, 0xee, 0x6a, 0xae, 0xee, 0x9c, 0x62, 0x2e, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00};const byte imgSwPsd[] PROGMEM ={ 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x1c, 0xdb, 0x30, 0x6b, 0x5a, 0xd6, 0x6b, 0x5a, 0xf6, 0x18, 0x5b, 0x32, 0x7b, 0x5b, 0xd6, 0x7b, 0x5a, 0xd6, 0x7b, 0x67, 0x30, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00};//Small icons ---------------------------------------------------------------------------------const byte imgSqrSmall[] PROGMEM ={ 0x00, 0x00, 0x3e, 0x00, 0x22, 0x00, 0x22, 0x00, 0x22, 0x00, 0x22, 0x00, 0xe3, 0x80, 0x00, 0x00};const byte imgSinSmall[] PROGMEM ={ 0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0x84, 0x80, 0x84, 0x80, 0x03, 0x00, 0x00, 0x00};const byte imgTriSmall[] PROGMEM ={ 0x00, 0x00, 0x20, 0x00, 0x50, 0x00, 0x88, 0x80, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00};const byte imgAcSmall[] PROGMEM ={ 0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0x84, 0x80, 0x84, 0x80, 0x03, 0x00, 0x00, 0x00};const byte imgDcSmall[] PROGMEM ={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00};const byte imgOffSmall[] PROGMEM ={ 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x14, 0x00, 0x08, 0x00, 0x14, 0x00, 0x22, 0x00, 0x00, 0x00};//Total program memory space used by icons data:1148 byte#endif

Schémas

Display type updated

Processus de fabrication

  1. Capturer les gouttes d'eau avec Arduino
  2. Arduino Spybot
  3. FlickMote
  4. Téléviseur maison B-Gone
  5. horloge maîtresse
  6. Trouvez-moi
  7. Puissance Arduino
  8. Planche à roulettes en réalité virtuelle DIY
  9. Comment interfacer Arduino Mega avec le module GPS NEO-6M