Raspberry Sense HAT test

apt-get update
apt-get install sense-hat
pip install pillow
#!/usr/bin/python
#arc en ciel arrêt CTLR/C
import time
from sense_hat import SenseHat
import signal
import os
import time

sense = SenseHat()

print('Mon PID est:', os.getpid())

def receiveSignal(signalNumber, frame):
	print('Demande arret:', signalNumber)
	sense.clear()
	exit()
	return	
	
if __name__ == '__main__':
    # register the signals to be caught
    signal.signal(signal.SIGHUP, receiveSignal)
    signal.signal(signal.SIGINT, receiveSignal)
    signal.signal(signal.SIGQUIT, receiveSignal)
    signal.signal(signal.SIGILL, receiveSignal)
    signal.signal(signal.SIGTRAP, receiveSignal)
    signal.signal(signal.SIGABRT, receiveSignal)
    signal.signal(signal.SIGBUS, receiveSignal)
    signal.signal(signal.SIGFPE, receiveSignal)
    #signal.signal(signal.SIGKILL, receiveSignal)
    signal.signal(signal.SIGUSR1, receiveSignal)
    signal.signal(signal.SIGSEGV, receiveSignal)
    signal.signal(signal.SIGUSR2, receiveSignal)
    signal.signal(signal.SIGPIPE, receiveSignal)
    signal.signal(signal.SIGALRM, receiveSignal)
    signal.signal(signal.SIGTERM, receiveSignal)


sense.low_light = True
pixels = [
    [255, 0, 0], [255, 0, 0], [255, 87, 0], [255, 196, 0], [205, 255, 0], [95, 255, 0], [0, 255, 13], [0, 255, 122],
    [255, 0, 0], [255, 96, 0], [255, 205, 0], [196, 255, 0], [87, 255, 0], [0, 255, 22], [0, 255, 131], [0, 255, 240],
    [255, 105, 0], [255, 214, 0], [187, 255, 0], [78, 255, 0], [0, 255, 30], [0, 255, 140], [0, 255, 248], [0, 152, 255],
    [255, 223, 0], [178, 255, 0], [70, 255, 0], [0, 255, 40], [0, 255, 148], [0, 253, 255], [0, 144, 255], [0, 34, 255],
    [170, 255, 0], [61, 255, 0], [0, 255, 48], [0, 255, 157], [0, 243, 255], [0, 134, 255], [0, 26, 255], [83, 0, 255],
    [52, 255, 0], [0, 255, 57], [0, 255, 166], [0, 235, 255], [0, 126, 255], [0, 17, 255], [92, 0, 255], [201, 0, 255],
    [0, 255, 66], [0, 255, 174], [0, 226, 255], [0, 117, 255], [0, 8, 255], [100, 0, 255], [210, 0, 255], [255, 0, 192],
    [0, 255, 183], [0, 217, 255], [0, 109, 255], [0, 0, 255], [110, 0, 255], [218, 0, 255], [255, 0, 183], [255, 0, 74]
]

msleep = lambda x: time.sleep(x / 1000.0)

def next_colour(pix):
    r = pix[0]
    g = pix[1]
    b = pix[2]

    if (r == 255 and g < 255 and b == 0):
        g += 1

    if (g == 255 and r > 0 and b == 0):
        r -= 1

    if (g == 255 and b < 255 and r == 0):
        b += 1

    if (b == 255 and g > 0 and r == 0):
        g -= 1

    if (b == 255 and r < 255 and g == 0):
        r += 1

    if (r == 255 and b > 0 and g == 0):
        b -= 1

    pix[0] = r
    pix[1] = g
    pix[2] = b

while True:
    for pix in pixels:
        next_colour(pix)

    sense.set_pixels(pixels)
    msleep(0.5)
	
	

https://pythonhosted.org/sense-hat/api/#led-matrix

ESP8266 0.91 pouces OLED CP2014

Puce WIFI 1*0.91  »ESP8266 0.91 pouces OLED CP2014 32 mo Flash ESP 8266 Module Internet des objets carte PCB NodeMcu pour Arduino IOT

https://www.arduino.cc/en/software Installer l’IDE toutes options dont pilotes

Fichiers->préférence->paramètres-> URL de gestionnaires de cartes… https://arduino.esp8266.com/stable/package_esp8266com_index.json

Croquis-> inclure bibliothèques-> gérer -> rechercher u8g2-> installer

Outils-> type de carte->gestionnaire de carte->ajouter NODEMCU

Outil -> type de carte ->NODEMCU 1.0 (ESP-12E Module)

Port com -> le nouveau quand on branche la carte

//exemple de code
#include <U8g2lib.h>
//U8g2 Contructor
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ 16, /* clock=*/ 5, /* data=*/ 4);
// Alternative board version. Uncomment if above doesn't work.
// U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ 4, /* clock=*/ 14, /* data=*/ 2);

u8g2_uint_t offset;     // current offset for the scrolling text
u8g2_uint_t width;      // pixel width of the scrolling text (must be lesser than 128 unless U8G2_16BIT is defined
char *text = "MESSAGE DE TEST "; // scroll this text from right to left
int passage =0;

void setup(void) {
  u8g2.begin();

  u8g2.setFont(u8g2_font_logisoso32_tf); // set the target font to calculate the pixel width
  width = u8g2.getUTF8Width(text);    // calculate the pixel width of the text

  u8g2.setFontMode(0);    // enable transparent mode, which is faster
}


void loop(void) {
  u8g2_uint_t x;

//text=text.concat(String(passage));
  u8g2.firstPage();
  do {
    passage=passage+1;
    // draw the scrolling text at current offset
    x = offset;
    u8g2.setFont(u8g2_font_logisoso32_tf);   // set the target font
    do {                // repeated drawing of the scrolling text...
      u8g2.drawUTF8(x, 32, text);     // draw the scolling text
      x += width;           // add the pixel width of the scrolling text
    } while ( x < u8g2.getDisplayWidth() );   // draw again until the complete display is filled

    u8g2.setFont(u8g2_font_logisoso32_tf);   // draw the current pixel width
    u8g2.setCursor(0, 64);
    u8g2.print(width);          // this value must be lesser than 128 unless U8G2_16BIT is set

  } while ( u8g2.nextPage() );

  offset -= 1;            // scroll by one pixel
  if ( (u8g2_uint_t)offset < (u8g2_uint_t) - width )
    offset = 0;             // start over again
}

https://arduinogetstarted.com/tutorials/arduino-http-request

https://www.tinkercad.com

kdevtmpfsi kinsing docker php-fpm

docker ps
docker exec -it nom_de_la_vm /bin/bash
cd /tmp
ls  #-> vérifier si kdevtmpfsi et kinsing
kill -9 $(pidof kdevtmpfsi)
kill -9 $(pidof kinsing)
rm -f /tmp/kdevtmpfsi ; echo "prend_la_place" > /tmp/kdevtmpfsi
rm -f /var/tmp/kinsing ; echo "prend_la_place" > /var/tmp/kinsing
rm -f /tmp/zzz ; echo "prend_la_place" > /tmp/zzz
rm -f /tmp/zzz.sh ; echo "prend_la_place" > /tmp/zzz.sh

# nouvelles variantes solution provisoire
#*******************************************
docker exec -it nom_de_la_vm /bin/bash
apt-get update
apt-get remove curl
dans  /home/tt.sh
pkill kdevtmpfsi
pkill kinsing
rm /tmp/kdevtmpfsi*
rm /tmp/kinsing*
rm /var/tmp/kdevtmpfsi*
rm /var/tmp/kinsing*

chmod 0744 /home/tt.sh

crontab -e
0 */5 * * * /home/tt.sh

#************************************

TVA <--> TTC <--> HT

TVA TAUX
HT
TVA
TTC