Skip to content

Commit 0688aca

Browse files
committed
Upgrading ev3dev-lang-java version
Fixing issue with packages
1 parent a48a524 commit 0688aca

File tree

13 files changed

+124
-13
lines changed

13 files changed

+124
-13
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ allprojects {
1414
apply plugin: 'idea'
1515

1616
dependencies {
17-
compile("com.github.ev3dev-lang-java:ev3dev-lang-java:2.4.16")
17+
compile("com.github.ev3dev-lang-java:ev3dev-lang-java:2.5.3")
1818
compile("com.github.ev3dev-lang-java:lejos-navigation:0.2.0")
1919

2020
compile("ch.qos.logback:logback-classic:1.2.3")

demo-2.4.16/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ dependencies {
66
//compile("com.github.ev3dev-lang-java:RPLidar4J:v0.3.2-SNAPSHOT")
77
//compile group: 'javazoom', name: 'jlayer', version: '1.0.1'
88

9+
annotationProcessor("org.projectlombok:lombok:1.16.20")
10+
compileOnly("org.projectlombok:lombok:1.16.20")
11+
testCompileOnly("org.projectlombok:lombok:1.16.20")
12+
13+
914
}

demo-2.4.16/src/main/java/examples/WebControl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
package examples;
22

3+
import lombok.extern.slf4j.Slf4j;
34
import org.slf4j.Logger;
45
import org.slf4j.LoggerFactory;
56

67
import java.io.*;
78
import java.net.ServerSocket;
89
import java.net.Socket;
910

10-
11+
@Slf4j
1112
public class WebControl {
1213

13-
public static Logger LOGGER = LoggerFactory.getLogger(WebControl.class);
14+
//public static Logger LOGGER = LoggerFactory.getLogger(WebControl.class);
1415

1516
public static final int PORT = 9000;
1617
private ServerSocket ss;
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
package ev3dev.actuators.ev3;
2+
3+
import ev3dev.actuators.LCD;
4+
import ev3dev.utils.JarResource;
5+
import lejos.hardware.lcd.GraphicsLCD;
6+
import lejos.robotics.Color;
7+
import lejos.utility.Delay;
8+
import org.slf4j.Logger;
9+
import org.slf4j.LoggerFactory;
10+
11+
import java.awt.image.BufferedImage;
12+
import java.io.IOException;
13+
14+
public class LCDCircles {
15+
16+
public static Logger LOGGER = LoggerFactory.getLogger(LCDCircles.class);
17+
18+
private GraphicsLCD lcd;
19+
20+
public LCDCircles() {
21+
22+
lcd = LCD.getInstance();
23+
24+
showJavaLogo(lcd);
25+
26+
Delay.msDelay(4000);
27+
28+
clear(lcd);
29+
fourFractalCircle(
30+
1,
31+
25,
32+
0,
33+
128,
34+
lcd);
35+
36+
Delay.msDelay(5000);
37+
38+
clear(lcd);
39+
fourFractalCircle(
40+
2,
41+
25,
42+
0,
43+
128,
44+
lcd);
45+
46+
Delay.msDelay(5000);
47+
48+
clear(lcd);
49+
fourFractalCircle(
50+
3,
51+
25,
52+
0,
53+
128,
54+
lcd);
55+
56+
Delay.msDelay(5000);
57+
58+
clear(lcd);
59+
fourFractalCircle(
60+
4,
61+
25,
62+
0,
63+
128,
64+
lcd);
65+
66+
Delay.msDelay(5000);
67+
}
68+
69+
70+
public static void main(String[] args) {
71+
LCDCircles main = new LCDCircles();
72+
}
73+
74+
public static void fourFractalCircle(int interacoes, int x, int y, int tamanho, GraphicsLCD g) {
75+
if (interacoes == 0) {
76+
77+
} else {
78+
g.setColor(Color.BLACK);
79+
g.drawOval(x, y, tamanho, tamanho);
80+
g.refresh();
81+
fourFractalCircle(interacoes - 1, x+tamanho / 4, y, tamanho / 2, g); //chamada recurssiva para desenhar circulos na parte superior
82+
fourFractalCircle(interacoes - 1, x, y+tamanho / 4, tamanho / 2, g);//chamada recurssiva para desenhar circulos na parte esquerda
83+
fourFractalCircle(interacoes - 1, x + tamanho / 2, y+tamanho / 4, tamanho / 2, g);////chamada recurssiva para desenhar circulos na parte direita
84+
fourFractalCircle(interacoes - 1, x+ tamanho / 4, y + tamanho / 2, tamanho / 2, g);//chamada recurssiva para desenhar circulos na parte inferior
85+
}
86+
}
87+
88+
public static void clear(GraphicsLCD g) {
89+
//lcd.setColor(Color.WHITE);
90+
g.setColor(255,255,255);
91+
g.fillRect(0,0, g.getWidth(), g.getHeight());
92+
}
93+
94+
public static final String JAVA_DUKE_IMAGE_NAME = "java_logo.png";
95+
96+
private static void showJavaLogo(GraphicsLCD lcd) {
97+
98+
try {
99+
BufferedImage image = JarResource.loadImage(JAVA_DUKE_IMAGE_NAME);
100+
lcd.drawImage(image, 35, 10, 0);
101+
lcd.refresh();
102+
}catch (IOException e){
103+
LOGGER.error(e.getLocalizedMessage());
104+
}
105+
}
106+
}

ev3dev-lang-java/src/main/java/ev3dev/actuators/ev3/LCDDrawIconsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package examples.actuators.ev3;
1+
package ev3dev.actuators.ev3;
22

33
import ev3dev.actuators.LCD;
44
import ev3dev.hardware.EV3DevDistro;

ev3dev-lang-java/src/main/java/ev3dev/actuators/ev3/LCDDrawImagesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package examples.actuators.ev3;
1+
package ev3dev.actuators.ev3;
22

33
import ev3dev.actuators.LCD;
44
import ev3dev.hardware.EV3DevDistro;

ev3dev-lang-java/src/main/java/ev3dev/actuators/ev3/LCDDrawLinesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package examples.actuators.ev3;
1+
package ev3dev.actuators.ev3;
22

33
import ev3dev.actuators.LCD;
44
import ev3dev.hardware.EV3DevDistro;

ev3dev-lang-java/src/main/java/ev3dev/actuators/ev3/LCDDrawRectanglesAnimationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package examples.actuators.ev3;
1+
package ev3dev.actuators.ev3;
22

33
import ev3dev.actuators.LCD;
44
import ev3dev.hardware.EV3DevDistro;

ev3dev-lang-java/src/main/java/ev3dev/actuators/ev3/LCDDrawRectanglesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package examples.actuators.ev3;
1+
package ev3dev.actuators.ev3;
22

33
import ev3dev.actuators.LCD;
44
import ev3dev.hardware.EV3DevDistro;

ev3dev-lang-java/src/main/java/ev3dev/actuators/ev3/LCDFontTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package examples.actuators.ev3;
1+
package ev3dev.actuators.ev3;
22

33
import ev3dev.actuators.LCD;
44
import ev3dev.hardware.EV3DevDistro;

0 commit comments

Comments
 (0)