Skip to content

Commit ed46c1b

Browse files
committed
Version 0.0.2
1 parent 5e15a18 commit ed46c1b

13 files changed

Lines changed: 179 additions & 46 deletions
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,32 @@
88

99
ser = serial.Serial('/dev/ttyUSB0',9600)
1010

11+
12+
def color2alpha(arr):
13+
new_arr = []
14+
for old_value in arr:
15+
new_value = int((old_value / 255) * 25 + 97)
16+
new_arr.append(new_value)
17+
return new_arr
18+
1119
def sendImage(image_name):
1220
img = Image.open(image_name)
1321

1422
img_array = np.array(img)
1523

24+
#print(img_array)
25+
1626
my_array = img_array.reshape((10, 10, 3))
1727

1828
color_flat = my_array.flatten()
29+
30+
print(color_flat)
31+
32+
new_color_flat = color2alpha(color_flat)
33+
34+
print(new_color_flat)
1935

20-
color_str = ''.join(map(chr, color_flat))
36+
color_str = ''.join(map(chr, new_color_flat))
2137

2238
print(color_str)
2339

doc.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
1-
util01@station173:~$ python3
1+
Panel Led
2+
=========
3+
4+
5+
#### 1/ Programme Arduino.
6+
7+
```
8+
panel_led.ino
9+
```
10+
11+
12+
#### 2/ Programme Python3.
13+
14+
- Initialisation de l'interface série :
15+
16+
```
17+
$ python3
218
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
319
Type "help", "copyright", "credits" or "license" for more information.
420
>>> import serial;
521
>>> ser = serial.Serial('/dev/ttyUSB0',9600)
6-
>>> variable = "send"
7-
>>> ser.write(variable.encode())
8-
4
9-
>>>
22+
```
23+
24+
- Envoyer le dessin de lettre A :
25+
26+
```
27+
$ ./sendletter.py
28+
```
29+
30+
- Effacer le panel led :
1031

11-
util01@station173:~/Arduino/panel_led_8$ python3 ./sendletter.py
12-
util01@station173:~/Arduino/panel_led_8$ python3 ./clearletter.py
32+
```
33+
$ ./clear.py
34+
```

hacklab.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

image.png

-8.55 KB
Binary file not shown.

image_a.png

-8.83 KB
Binary file not shown.

image_b.png

-8.85 KB
Binary file not shown.

image_c.png

-8.5 KB
Binary file not shown.

image_color.png

1.62 KB
Loading

image_h.png

-8.55 KB
Binary file not shown.

image_k.png

-8.75 KB
Binary file not shown.

0 commit comments

Comments
 (0)