Skip to content

Commit aac9f3f

Browse files
author
bitluni
committed
latest version of dev merged
1 parent 63dde9f commit aac9f3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1682
-1639
lines changed

examples/1BitMode/1BitMode.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//cc by-sa 4.0 license
44
//bitluni
55

6-
#include <ESP32Lib.h>
6+
#include <ESP32Video.h>
77
#include <Ressources/Font6x8.h>
88

99
//pin configuration

examples/6BitMode/6BitMode.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//bitluni
44

55
//include libraries
6-
#include <ESP32Lib.h>
6+
#include <ESP32Video.h>
77
#include <Ressources/Font6x8.h>
88

99
//VGA Device

examples/8BitDACMode/8BitDACMode.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
depending on the monochrome color of choice
2323
*/
2424

25-
#include <ESP32Lib.h>
25+
#include <ESP32Video.h>
2626
#include <Ressources/Font6x8.h>
2727

2828
//pin configuration

examples/CompositeDACColorMode/CompositeDACColorMode.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
Custom ladders can be used by tweaking colorMinValue and colorMaxValue
3737
*/
3838

39-
#include <ESP32Lib.h>
39+
#include <ESP32Video.h>
4040
#include <Ressources/CodePage437_8x8.h>
4141

4242
//pin configuration for DAC

examples/CompositeDACMode/CompositeDACMode.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
Custom ladders can be used by tweaking colorMinValue and colorMaxValue
3737
*/
3838

39-
#include <ESP32Lib.h>
39+
#include <ESP32Video.h>
4040
#include <Ressources/Font6x8.h>
4141

4242
//pin configuration for DAC

examples/GFXWrapper/GFXWrapper.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//cc by-sa 4.0 license
33
//bitluni
44

5-
#include <ESP32Lib.h>
5+
#include <ESP32Video.h>
66
#include <Ressources/Font6x8.h>
77
#include <GfxWrapper.h>
88
#include <Fonts/FreeMonoBoldOblique24pt7b.h>

examples/Raytracer/Raytracer.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//cc by-sa 4.0 license
33
//bitluni
44

5-
#include <ESP32Lib.h>
5+
#include <ESP32Video.h>
66
#include <Ressources/Font6x8.h>
77
#include <math.h>
88
#include <Math/Matrix.h>

examples/TextMode/TextMode.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//cc by-sa 4.0 license
44
//bitluni
55

6-
#include <ESP32Lib.h>
6+
#include <ESP32Video.h>
77
#include <Ressources/Font6x8.h>
88

99
//pin configuration

examples/VGA2DFeatures/VGA2DFeatures.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//bitluni
55

66
//include libraries
7-
#include <ESP32Lib.h>
7+
#include <ESP32Video.h>
88
#include <Ressources/Font6x8.h>
99

1010
//include a sprite

examples/VGA3DEngine/VGA3DEngine.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//bitluni
55

66
//include libraries
7-
#include <ESP32Lib.h>
7+
#include <ESP32Video.h>
88
#include <Ressources/Font6x8.h>
99

1010
//include model

examples/VGACustomResolution/VGACustomResolution.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//bitluni
55

66
//including the needed header
7-
#include <ESP32Lib.h>
7+
#include <ESP32Video.h>
88
#include <Ressources/Font6x8.h>
99

1010
//pin configuration

examples/VGADemo14Bit/VGADemo14Bit.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//cc by-sa 4.0 license
44
//bitluni
55

6-
#include <ESP32Lib.h>
6+
#include <ESP32Video.h>
77
#include <Ressources/Font6x8.h>
88
#include <math.h>
99

examples/VGAFonts/VGAFonts.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//cc by-sa 4.0 license
44
//bitluni
55

6-
#include <ESP32Lib.h>
6+
#include <ESP32Video.h>
77
#include <Ressources/CodePage437_8x8.h>
88
#include <Ressources/CodePage437_8x14.h>
99
#include <Ressources/CodePage437_8x16.h>

examples/VGAHelloWorld/VGAHelloWorld.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//cc by-sa 4.0 license
44
//bitluni
55

6-
#include <ESP32Lib.h>
6+
#include <ESP32Video.h>
77
#include <Ressources/Font6x8.h>
88

99
//pin configuration

examples/VGAHighRes/VGAHighRes.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//bitluni
88

99
//including the needed header
10-
#include <ESP32Lib.h>
10+
#include <ESP32Video.h>
1111
#include <Ressources/Font6x8.h>
1212

1313
//pin configuration
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
//This example shows a simple "Hello world!" on a VGA screen.
2+
//You need to connect a VGA screen cable to the pins specified below.
3+
//cc by-sa 4.0 license
4+
//bitluni
5+
6+
#include <ESP32Video.h>
7+
#include <Ressources/Font6x8.h>
8+
#include "VGA/VGA4ColorMultimonitor.h"
9+
10+
//pin configuration
11+
12+
//red pins
13+
const int redPin = 17;
14+
const int redPin2 = 2;
15+
const int redPin3 = 19;
16+
const int redPin4 = 12;
17+
//const int M4Pin = 23;
18+
//const int M5Pin = 26;
19+
//green pins
20+
const int greenPin = 16;
21+
const int greenPin2 = 15;
22+
const int greenPin3 = 18;
23+
const int greenPin4 = 14;
24+
//const int M4Pin = 22;
25+
//const int M5Pin = 25;
26+
//blue pins
27+
const int bluePin = 4;
28+
const int bluePin2 = 13;
29+
const int bluePin3 = 5;
30+
const int bluePin4 = 27;
31+
//const int M4Pin = 21;
32+
//const int M5Pin = 0;
33+
const int hsyncPin = 32;
34+
const int vsyncPin = 33;
35+
36+
//VGA Device
37+
VGA4ColorMultimonitor videodisplay;
38+
39+
void setup()
40+
{
41+
//initializing vga at the specified pins
42+
videodisplay.init(VGAMode::MODE320x240, redPin, greenPin, bluePin,
43+
redPin2, greenPin2, bluePin2,
44+
redPin3, greenPin3, bluePin3,
45+
redPin4, greenPin4, bluePin4,
46+
-1, -1, hsyncPin, vsyncPin, -1,2,2);
47+
//selecting the font
48+
videodisplay.setFont(Font6x8);
49+
//displaying the text
50+
videodisplay.fillCircle(140,10,5,1);
51+
videodisplay.fillCircle(140+20+videodisplay.mode.hRes,10,5,1);
52+
videodisplay.fillCircle(140+20*2+videodisplay.mode.hRes*2,10,5,1);
53+
videodisplay.fillCircle(140,30+videodisplay.mode.vRes,5,1);
54+
videodisplay.fillCircle(140+20+videodisplay.mode.hRes,30+videodisplay.mode.vRes,5,1);
55+
videodisplay.fillCircle(140+20*2+videodisplay.mode.hRes*2,30+videodisplay.mode.vRes,5,1);
56+
videodisplay.fillCircle(videodisplay.mode.hRes/2,videodisplay.mode.vRes/videodisplay.mode.vDiv,80,videodisplay.RGB(255,255,0));
57+
videodisplay.fillCircle(videodisplay.mode.hRes,videodisplay.mode.vRes/videodisplay.mode.vDiv/2,80,videodisplay.RGB(255,0,255));
58+
59+
videodisplay.setFont(Font6x8);
60+
61+
for(int xmon = 0; xmon < 3; xmon++)
62+
{
63+
for(int ymon = 0; ymon < 2; ymon++)
64+
{
65+
videodisplay.line(xmon*320 + 160-14,ymon*240+120+3,xmon*320 + 160+22,ymon*240+120+3,videodisplay.RGB(0,255,255));
66+
videodisplay.line(xmon*320 + 160-2,ymon*240+120-12,xmon*320 + 160-2,ymon*240+120+18,videodisplay.RGB(0,255,0));
67+
}
68+
}
69+
70+
videodisplay.setCursor(160-12,120-5);
71+
videodisplay.println("1!");
72+
videodisplay.setCursor(160+320,120-5);
73+
videodisplay.println("2!");
74+
videodisplay.setCursor(160-12,120+240+5);
75+
videodisplay.println("3!");
76+
videodisplay.setCursor(160+320,120+240+5);
77+
videodisplay.println("4!");
78+
79+
}
80+
81+
void loop()
82+
{
83+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#include <ESP32Video.h>
2+
#include <Ressources/Font6x8.h>
3+
#include "VGA/VGA6MonochromeVGAMadnessMultimonitor.h"
4+
5+
//pin configuration
6+
//red pins
7+
const int redPin0 = 17;
8+
const int redPin1 = 2;
9+
const int redPin2 = 19;
10+
const int redPin3 = 12;
11+
const int redPin4 = 23;
12+
const int redPin5 = 26;
13+
//green pins
14+
const int greenPin0 = 16;
15+
const int greenPin1 = 15;
16+
const int greenPin2 = 18;
17+
const int greenPin3 = 14;
18+
const int greenPin4 = 22;
19+
const int greenPin5 = 25;
20+
//blue pins
21+
const int bluePin0 = 4;
22+
const int bluePin1 = 13;
23+
const int bluePin2 = 5;
24+
const int bluePin3 = 27;
25+
const int bluePin4 = 21;
26+
const int bluePin5 = 0;
27+
const int hsyncPin = 32;
28+
const int vsyncPin = 33;
29+
30+
//VGA Device
31+
VGA6MonochromeVGAMadnessMultimonitor videodisplay;
32+
33+
void setup()
34+
{
35+
Serial.begin(115200);
36+
//selecting the foreground or background color per monitor
37+
//IMPORTANT: for monochrome mode this MUST be done BEFORE init
38+
// and color can not be changed after init
39+
//videodisplay.setMonitor(); // selects all outputs simultaneously (default)
40+
41+
videodisplay.setMonitor(0);
42+
videodisplay.setFrontGlobalColor(255,255,0);
43+
videodisplay.setBackGlobalColor(255,0,0);
44+
45+
videodisplay.setMonitor(1);
46+
videodisplay.setFrontGlobalColor(255,255,255);
47+
videodisplay.setBackGlobalColor(0,0,0);
48+
49+
videodisplay.setMonitor(2);
50+
videodisplay.setFrontGlobalColor(0,255,255);
51+
videodisplay.setBackGlobalColor(0,0,255);
52+
53+
videodisplay.setMonitor(3);
54+
videodisplay.setFrontGlobalColor(255,0,0);
55+
videodisplay.setBackGlobalColor(0,0,0);
56+
57+
videodisplay.setMonitor(4);
58+
videodisplay.setFrontGlobalColor(255,0,255);
59+
videodisplay.setBackGlobalColor(0,0,255);
60+
61+
videodisplay.setMonitor(5);
62+
videodisplay.setFrontGlobalColor(0,255,0);
63+
videodisplay.setBackGlobalColor(0,0,0);
64+
65+
//because of hardware limitations only BackGlobalColors compatible with FrontGlobalColor will set a non-black background:
66+
// FrontGlobalColor - cyan, BackGlobalColors - green or blue
67+
// FrontGlobalColor - magenta, BackGlobalColors - red or blue
68+
// FrontGlobalColor - yellow, BackGlobalColors - red or green
69+
// FrontGlobalColor - white, BackGlobalColors - any
70+
71+
//initializing vga at the specified pins
72+
videodisplay.init(VGAMode::MODE320x240,
73+
redPin0,greenPin0,bluePin0,
74+
redPin1,greenPin1,bluePin1,
75+
redPin2,greenPin2,bluePin2,
76+
redPin3,greenPin3,bluePin3,
77+
redPin4,greenPin4,bluePin4,
78+
redPin5,greenPin5,bluePin5,
79+
hsyncPin, vsyncPin, -1,3,2);
80+
//selecting the font
81+
videodisplay.setFont(Font6x8);
82+
83+
for(int xmon = 0; xmon < 3; xmon++)
84+
{
85+
for(int ymon = 0; ymon < 2; ymon++)
86+
{
87+
videodisplay.line(xmon*320 + 160-14,ymon*240+120+3,xmon*320 + 160+22,ymon*240+120+3,1);
88+
videodisplay.line(xmon*320 + 160-2,ymon*240+120-12,xmon*320 + 160-2,ymon*240+120+18,1);
89+
videodisplay.line(xmon*320 + 160+10,ymon*240+120-12,xmon*320 + 160+10,ymon*240+120+18,1);
90+
}
91+
}
92+
93+
videodisplay.setCursor(160-12,120-5);
94+
videodisplay.println("1!");
95+
videodisplay.setCursor(160+320,120-5);
96+
videodisplay.println("2!");
97+
videodisplay.setCursor(160+320+320+12,120-5);
98+
videodisplay.println("3!");
99+
videodisplay.setCursor(160-12,120+240+5);
100+
videodisplay.println("4!");
101+
videodisplay.setCursor(160+320,120+240+5);
102+
videodisplay.println("5!");
103+
videodisplay.setCursor(160+320+320+12,120+240+5);
104+
videodisplay.println("6!");
105+
}
106+
107+
108+
void loop() {
109+
}

0 commit comments

Comments
 (0)