» codelab : http://codelab.fr/accueil » Forum : Autres langages : http://codelab.fr/autres-langages » Requète GET : http://codelab.fr/5010 Ceci est la version imprimable d'un sujet du forum, pour retourner à la version complète : Requète GET |
Kévin51 — 2014-05-14 14:50:06 |
Bonjour, <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"> function PopupCentrer(page,largeur,hauteur,options) { var top=(screen.height-hauteur)/2; var left=(screen.width-largeur)/2; window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); } </SCRIPT> </HEAD> <body> <?php /*// le code PHP function open_infos() { window.open('https://www.google.fr/','nom_de_ma_popup','menubar=no, scrollbars=no, top=100, left=100, width=300, height=200'); } ?> */ <!-- retour au code HTML ---> <form>cliquez sur ce bouton : <input type='button' value='Action sur portail' onClick='PopupCentrer("https://www.google.fr/",500,70,"menubar=no,scrollbars=no,statusbar=no")'> </form> </body> </HTML> et mon code Arduino : const int APPUI=1; const int buttonPin = 2; // the number of the pushbutton pin const int ledPin = 13; // the number of the LED pin int ETAT_BP; // variables will change: int buttonState = 0; // variable for reading the pushbutton status void setup() { // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); digitalWrite (buttonPin, HIGH); } void loop(){ ETAT_BP=digitalRead(buttonPin); if (ETAT_BP==APPUI){ digitalWrite(ledPin, 1); delay(180000); } else { digitalWrite(ledPin, 0); } } Merci d'avance :) |