Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Duinoedu_Esp8266.h>
- #include <stdio.h>
- #include <ESP32Lib.h>
- #include <Duinoedu_Utility.conv.h>
- #include <Ressources/Font8x8.h>
- #include <Ressources/Font6x8.h>
- VGA3Bit vga;
- Duinoedu_Esp8266 MonEsp;
- int Integer = 0 ;
- int pot1;
- ESP8266WebServer server ( 80 );
- #include "rock.h"
- const int redPin = 14; //D7
- const int greenPin = 27; //D6
- const int bluePin = 16; //D5
- const int hsyncPin = 17; //D4
- const int vsyncPin = 25; //D3
- void setup()
- {
- vga.setFrameBufferCount(2);
- vga.init(vga.MODE320x200, redPin, greenPin, bluePin, hsyncPin, vsyncPin);
- // vga.init(vga.MODE320x200, D7, D6, D5, D4, D3);// vga.init(vga.MODE360x200, redPin, greenPin, bluePin, hsyncPin, vsyncPin);
- vga.clear(vga.RGBA(0, 0, 255));
- vga.backColor = vga.RGB(0, 128, 128);
- vga.setFont(Font8x8);
- vga.print("connection... ");
- MonEsp.connect_STA_smart("ssid","pwd");
- vga.clear(vga.RGBA(0, 0, 255));
- vga.setCursor(0, 0);
- vga.println("----------------------");
- vga.println("bitluni's VGA Terminal");
- vga.print("SSID: ");
- vga.println(PCHAR("VGA"));
- server.on ( "/", handleRoot );
- server.begin();
- Serial.println ( "HTTP server started" );
- //attention au font
- }
- void handleRoot(){
- MonEsp.updateStringint(&server,"pot1", pot1);
- server.send ( 200, "text/html", getPage() );
- delay(10);
- }
- String getPage(){
- #define PAGE_EXIST
- String page = "<!DOCTYPE html><html><head><meta charset='ISO-8859-15'>";
- page += "<title>DUINOEDU - www.duinoedu.com</title></head>";
- page += MonEsp.addPhoneStyle();
- page += "<BODY onload='process()'>";
- page += MonEsp.javaslider();
- page += MonEsp.slider( 0, 255, "pot1""");
- page += "</body>";
- page += "</html>";
- return page;
- }
- void loop()
- {
- #ifdef PAGE_EXIST
- server.handleClient();
- delay(10);
- #endif
- Integer = pot1 ;
- vga.clear(vga.RGBA(0, 0, 255));
- vga.setCursor(50, 50);
- vga.setFont(Font8x8);
- vga.print(PCHAR("coucou ma variable : "));
- vga.println(PCHAR(Integer));
- vga.setFont(Font6x8);
- vga.print(PCHAR("coucou ma variable : "));
- vga.println(PCHAR(Integer));
- vga.dot(200, 20, vga.RGB(4, 0, 250));
- vga.line(50,10, 32 + 40 , 30, vga.RGB(0, 4, 250));
- vga.rect(50, 15, 3,19 , vga.RGB(0, 5, 25));
- vga.fillRect(150, 15, 35,16 , vga.RGB(20,42, 0));
- vga.circle(55,20, 20, vga.RGB(230, 0, 20));
- vga.circle(55,20, 20, vga.RGB(230, 0, 20));
- vga.fillEllipse(170,20, 16,5 , vga.RGB(200, 50, 0));
- vga.fillCircle(Integer, 150, 20, vga.RGB(0, 255, 255));
- vga.setTextColor(vga.RGB(255, 255, 255));
- //debut du code pour l image
- rock.drawMix(vga, (millis() / 50) & 15, 65, 125);
- //fin du code pour l'image
- vga.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement