samedi 22 février 2014

Sub voyant bouton

un programme de démonstration d'une "sub"
 pour créer un bouton ou un voyant avec différentes couleurs du voyant
 et de l'étiquette  avec le texte de l'étiquette  et aussi
 un coefficient de zoom pour le voyant ou le bouton






Code Panoramic :

' =============================
 dim varcoul,nobj
 label sp_1
' ..................             +Numéro objet
'                                 !    +parent
'                                 !     !   +top
'                                 !     !    !    + left
'                                 !     !    !    !    + b=bouton v=voyant
'                                 !     !    !    !    !    + texte étiquette
'                                 !     !    !    !    !     !      + couleur voyant
'                                 !     !    !    !    !     !      !       + couleur étiquette
'                                 !     !    !    !    !     !      !        !        + coefficient zoom
'                                 !     !    !    !    !     !      !        !        !     +font_size
'                                 !     !    !    !    !     !      !        !        !     !
' sub voyant_button(ntp,par,ttp,ltp,bv$,txt$,colv$,cole$,cf,fz)
width 0,600:height 0,300: color 0,250,150,50
nobj=10:voyant_button(nobj,0,20,50,"b"," Marche","r","j",2.2,5)
nobj=20:voyant_button(nobj,0,20,150,"v"," Marche","v","v",2.4,5)
nobj=30:voyant_button(nobj,0,20,250,"v","   Arrêt","r","r",2.8,5)
nobj=40:voyant_button(nobj,0,20,350,"v"," Pompe 1","b","b",3,4)
 on_click 15,sp_1
' =============================
 end
' =============================
 sp_1:
 varcoul=1-varcoul
 select varcoul
 case 0
 color 25,39,99,37
 color 35 ,113,41,17
 color 45,100,100,255
 case 1
 color 25,0,255,0
 color 35,255,0,0
 color 45,0,200,255
 end_select
return
' =============================
rem ======SUB===================================
' =============================
sub voyant_button(ntp,par,ttp,ltp,bv$,txt$,colv$,cole$,coef,fz)
 dim_local htop
 panel ntp+1 :color ntp+1,55,55,50:top ntp+1,ttp:left ntp+1,ltp
 width ntp+1,30*coef:height ntp+1,40*coef
 panel ntp+2 :parent ntp+2,ntp+1
 if cole$= "j" then color ntp+2,255,255,0
 if cole$= "r" then color ntp+2,255,0,0
 if cole$= "v" then color ntp+2,0,255,0
 if cole$= "b" then color ntp+2,0,200,255
 width ntp+2,26*coef:height ntp+2,9*coef
 left ntp+2,(width(ntp+1)-width(ntp+2))/2
 alpha ntp+3:parent ntp+3,ntp+2:full_space ntp+3
 panel ntp+4 :parent ntp+4,ntp+1:color ntp+4,206,206,206
 left ntp+4,width(ntp+1)-width(ntp+4)/2
 width ntp+4,26*coef:height ntp+4,26*coef
 left ntp+4,(width(ntp+1)-width(ntp+4))/2
 htop=(height(ntp+1)-(height(ntp+2)+height(ntp+4)))/3
 top ntp+2, htop:top ntp+4, htop+top(ntp+2)+height(ntp+2)
 if bv$="b"
    button ntp+5 :parent ntp+5,ntp+4
 else
    panel ntp+5 :parent ntp+5,ntp+4
    if colv$="r"
       color ntp+5,113,41,17:end_if
    if colv$="v"
       color ntp+5,39,99,37:end_if
    if colv$="b"
       color ntp+5,39,99,255:end_if
 end_if
 width ntp+5,22*coef:height ntp+5,22*coef
 top ntp+5,(height(ntp+4)-height(ntp+5))/2
 left ntp+5,(width(ntp+4)-width(ntp+5))/2
 font_size ntp+3,fz*coef : caption ntp+3,txt$
end_sub
' =============================


lundi 17 février 2014

le site "skytopic org" parle de panoramic-arduino
http://informatique.skytopic.org/16618272936-panoramic-arduino
information de "Jicehel" Merci

dimanche 16 février 2014

Clavier Matriciel


le schémas du clavier  du site "modelisme.com "



 Utilisation de clavier matriciel 4 x3 boutons
    tiptopboards.com
    Rolland 23 08 2013
   http://tiptopboards.free.fr/arduino_forum/viewtopic.php?f=2&t=20
   

    // télécharger et installer la librairie Keypad
    //Traduction Google
   
//===================================================
    #include <Keypad.h>

    //Définition du clavier 4 x3 boutons
    const byte ROWS = 4; //4 lignes
    const byte COLS = 3; //3 colonnes
    // Donner un code Ascii aux 16 touches, par exemple 0-F
    char keys[ROWS][COLS] = {
      {'1','2','3'},
      {'4','5','6'},
      {'7','8','9'},
      {'A','0','B'}
    };
    byte rowPins[ROWS] = {5, 4, 3, 2}; //les 4 lignes du clavier sur les pins arduino digitales
    byte colPins[COLS] = {8, 7, 6}; //les 3colonnes du clavier

    //Créer cet objet clavier
    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );// defaut ???

    void setup(){
      Serial.begin(115200);   //Moniteur série (écran PC)
      Serial.println("Utilisation du clavier 12 touches");
    }

    void loop(){
      char key = keypad.getKey();   //Surveiller le calvier

      if (key != NO_KEY){
        Serial.println(key);  //Afficher le code ascii de la touche appuyée
      }
    }


samedi 15 février 2014

DLL"IO_Acces_Com" 


Comme le site "automatepc.fr" n'est plus accessible
voici les images du PDF (licence libre)que j' ai téléchargé