Hi,
i'm kinda new to arduino, have made some little project but never something this big.
I try to make a RS232 remote for an AV device that don't have any TCP control.
I have the hex code i have to send to the av device in a pdf file + find out how to calculate the checksum and eveything, i think my code is okay on this point.
I use an arduino UNO + a mux CD74HC4067 for my 15 boutons (that works well) + a SSD1306 oled display + a TTL to RS232 to output my hex code writen into the serial (classic port 0 and 1) (link : https://www.amazon.fr/dp/B09DYDFZRW?psc=1&ref=ppx_yo2ov_dt_b_product_details)
My code :
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// 'Sans titre-1', 128x64px
const unsigned char sony [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xff, 0xf0, 0xe0, 0x00, 0xff, 0xf8, 0x01, 0xff, 0x00, 0x7f, 0xf1, 0xff, 0xe0, 0x7f, 0xe0,
0x03, 0xff, 0xfd, 0xe0, 0x07, 0xff, 0xff, 0x03, 0xff, 0x80, 0x7f, 0xf9, 0xff, 0xf0, 0x7f, 0xe0,
0x07, 0xf0, 0x7f, 0xe0, 0x0f, 0xf0, 0x3f, 0x83, 0xff, 0xe0, 0x7f, 0xf1, 0xff, 0xf0, 0x7f, 0xe0,
0x0f, 0x80, 0x0f, 0xe0, 0x3f, 0x80, 0x0f, 0xe0, 0x3f, 0xf0, 0x07, 0x80, 0x3f, 0x80, 0x1f, 0x00,
0x1f, 0x00, 0x03, 0xe0, 0x7f, 0x00, 0x07, 0xe0, 0x3f, 0xf8, 0x07, 0x80, 0x1f, 0xc0, 0x3e, 0x00,
0x1f, 0x80, 0x01, 0xe0, 0x7e, 0x00, 0x07, 0xf0, 0x3f, 0xfc, 0x07, 0x80, 0x0f, 0xe0, 0x7c, 0x00,
0x1f, 0xc0, 0x00, 0xe0, 0xfe, 0x00, 0x03, 0xf8, 0x3f, 0xfe, 0x07, 0x80, 0x07, 0xf0, 0xf8, 0x00,
0x1f, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x03, 0xf8, 0x3d, 0xff, 0x07, 0x80, 0x03, 0xf9, 0xf0, 0x00,
0x0f, 0xff, 0xfc, 0x00, 0xfc, 0x00, 0x03, 0xf8, 0x3c, 0xff, 0x87, 0x80, 0x01, 0xff, 0xe0, 0x00,
0x0f, 0xff, 0xff, 0x80, 0xfc, 0x00, 0x03, 0xf8, 0x3c, 0x7f, 0xc7, 0x80, 0x01, 0xff, 0xc0, 0x00,
0x03, 0xff, 0xff, 0xc0, 0xfc, 0x00, 0x03, 0xf8, 0x3c, 0x3f, 0xe7, 0x80, 0x00, 0xff, 0x80, 0x00,
0x00, 0x7f, 0xff, 0xe0, 0xfc, 0x00, 0x03, 0xf8, 0x3c, 0x1f, 0xf7, 0x80, 0x00, 0x7f, 0x80, 0x00,
0x00, 0x01, 0xff, 0xf0, 0xfe, 0x00, 0x03, 0xf8, 0x3c, 0x0f, 0xff, 0x80, 0x00, 0x3f, 0x00, 0x00,
0x1c, 0x00, 0x0f, 0xf0, 0xfe, 0x00, 0x03, 0xf8, 0x3c, 0x03, 0xff, 0x80, 0x00, 0x3f, 0x00, 0x00,
0x1e, 0x00, 0x03, 0xf0, 0x7f, 0x00, 0x07, 0xf0, 0x3c, 0x01, 0xff, 0x80, 0x00, 0x3f, 0x00, 0x00,
0x1f, 0x00, 0x03, 0xf0, 0x7f, 0x00, 0x07, 0xe0, 0x3c, 0x00, 0xff, 0x80, 0x00, 0x3f, 0x00, 0x00,
0x1f, 0xc0, 0x03, 0xe0, 0x3f, 0x80, 0x1f, 0xe0, 0x3c, 0x00, 0x7f, 0x80, 0x00, 0x3f, 0x00, 0x00,
0x1f, 0xf8, 0x0f, 0xe0, 0x0f, 0xf0, 0x7f, 0x80, 0x7e, 0x00, 0x3f, 0x80, 0x03, 0xff, 0xc0, 0x00,
0x1f, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0x03, 0xff, 0xc0, 0x1f, 0x80, 0x03, 0xff, 0xf0, 0x00,
0x1c, 0x3f, 0xff, 0x00, 0x00, 0xff, 0xf8, 0x03, 0xff, 0xc0, 0x0f, 0x80, 0x03, 0xff, 0xf0, 0x00,
0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 1040)
const int sonyallArray_LEN = 1;
const unsigned char* sonyallArray[1] = {
sony
};
int freeRAM() {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
// BANQUE DE DONNEES HEXA
const byte xpt[14] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e};
const byte outs[3] = {0x00,0x02,0x03};
// Définition des broches
const int s0 = 2; // Broche S0
const int s1 = 3; // Broche S1
const int s2 = 4; // Broche S2
const int s3 = 5; // Broche S3
const int en = 6; // Broche d'activation (E) du multiplexeur
const int storeled = 8;
const int mux = 7;
bool boutons[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
bool pause = false;
// CHECKSUM
byte calculateChecksum(byte *data, int length) {
byte checksum = 0;
for (int i = 0; i < length; i++) {
checksum += data[i];
}
return ~checksum + 1; // Two's complement
}
// PAUSE
unsigned long derniereActivation = 0;
const unsigned long delaiMax = 20000;
// Stockage Variables
byte lastButtonState[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
byte lastStoreState[1] = {0};
byte variable = 1; // Variable maitresse, sert de fil rouge pour les fonctions inc/dec
byte variableOut = 1; // Variable pour la valeur d'out sur la memoire
byte variableIn = 1; // Variable pour la valeur d'in sur la memoire
byte memory[2][12] = {{0,1,2,3,4,5,6,7,8,9,10,11}, // Memoires d'inputs
{0,0,0,0,0,0,0,0,0,0,0 ,0 }}; // Memoires d'outputs // Données sur un ARRAY 3D // Configurées de base en 12 inputs sur la M/E 1 bus PGM
void setup() {
Serial.begin(38400);
Wire.begin();
Serial.println(freeRAM());
// Initialisation de l'écran OLED
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("Echec de l'initialisation de l'affichage OLED"));
for(;;);
}
pinMode(mux,INPUT_PULLUP);
pinMode(s0, OUTPUT);
pinMode(s1, OUTPUT);
pinMode(s2, OUTPUT);
pinMode(s3, OUTPUT);
pinMode(en, OUTPUT);
pinMode(storeled,OUTPUT);
digitalWrite(en, LOW);
bootscreen();
delay(3000);
}
void triggers(){
for (byte i = 0; i < 16; i++) {
digitalWrite(s0, i & 0x1);
digitalWrite(s1, (i >> 1) & 0x1);
digitalWrite(s2, (i >> 2) & 0x1);
digitalWrite(s3, (i >> 3) & 0x1);
boutons[i]= !digitalRead(mux);
}
}
void bootscreen(){
display.clearDisplay();
display.drawBitmap(
(display.width() - 128 ) / 2, // Position de l'extrême "gauche" de l'image (pour centrage écran, ici)
(display.height() - 64) / 2, // Position de l'extrême "haute" de l'image (pour centrage écran, ici)
sony, 128, 64, WHITE); // "couleur" de l'image
display.display();
}
void updateDisplay1() {
display.clearDisplay();
// INTRO
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0,0);
display.println("Sony MCS-8");
display.println("RS232 Remote V1.0");
display.drawLine(0, 16, SCREEN_WIDTH, 16, SSD1306_WHITE);
// INPUT / OUTPUT to STORE
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0,20);
display.print("Input : ");
display.println(variableIn);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(12,28);
display.print("Bus : ");
if (variableOut == 1) {
display.println("PGM");
} else if (variableOut == 2) {
display.println("Aux 1");
} else if (variableOut == 3) {
display.println("Aux 2");
}
// STORED
for (byte index = 0; index < 12; index++) {
if (boutons[index] == 1 && boutons[13] == 1){
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(84,20);
display.println("STORED");
}
}
// RECAP MEMOIRES 1 - INPUT
for (byte index = 0; index < 6; index++) {
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor((21*index +3),43);
display.print((memory[0][index]+1));
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor((21*index +3),54);
display.print((memory[0][index+6]+1));
// RECAP MEMOIRES 2 - BUS représentés par 0, 1 ou 2 points
if ((memory[1][index]) == 1){
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
display.setCursor((21*index +11),36);
display.print(".");
}
if ((memory[1][index+6]) == 1){
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
display.setCursor((21*index +11),47);
display.print(".");
}
if ((memory[1][index]) == 2){
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
display.setCursor((21*index +11),39);
display.print(":");
}
if ((memory[1][index+6]) == 2){
display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
display.setCursor((21*index +11),49);
display.print(":");
}
}
// RECAP MEMOIRES 3 - TABLEUR
display.drawLine(0, 40, SCREEN_WIDTH, 40, SSD1306_WHITE);
display.drawLine(0, 51, SCREEN_WIDTH, 51, SSD1306_WHITE);
display.drawLine(0, 63, SCREEN_WIDTH, 63, SSD1306_WHITE);
display.drawLine(0, 40, 0, 64, SSD1306_WHITE);
display.drawLine(21, 40, 21, 64, SSD1306_WHITE);
display.drawLine(42, 40, 42, 64, SSD1306_WHITE);
display.drawLine(63, 40, 63, 64, SSD1306_WHITE);
display.drawLine(84, 40, 84, 64, SSD1306_WHITE);
display.drawLine(105, 40, 105, 64, SSD1306_WHITE);
display.drawLine(127, 40, 127, 64, SSD1306_WHITE);
display.display();
}
void compteur() {
// FONCTIONS POUR INC/DEC les 2 variables In/Out + une variable maitresse
if (boutons[14] == 1 && boutons[13] == 0 ) {
variable++;
variableIn++;
Serial.print("INC++ - IN : ");
Serial.print(variableIn);
Serial.print(" OUT :");
Serial.println(variableOut);
Serial.println("");
delay(200); // Délai anti-rebond
}
if (boutons[15] == 1 && boutons[13] == 0) {
variable--;
variableIn--;
Serial.print("DEC-- - IN : ");
Serial.print(variableIn);
Serial.print(" OUT :");
Serial.println(variableOut);
Serial.println("");
delay(200); // Délai anti-rebond
}
// FONCTIONS POUR BLOQUER LES VARIABLES EN INC/DEC
if (variable < 1) {
variable = 42;
variableIn = 14;
variableOut = 3;
}
if (variable == 14) {
variableIn = 14;
variableOut = 1;
}
if (variable == 15) {
variableIn = 1;
variableOut = 2;
}
if (variable == 28) {
variableIn = 14;
variableOut = 2;
}
if (variable == 29) {
variableIn = 1;
variableOut = 3;
}
if (variable > 42) {
variable = 1;
variableIn = 1;
variableOut = 1;
}
}
void store(){
// LED BOUTON STORE
if (boutons[13] == 1){
digitalWrite(storeled, HIGH);
}
if (boutons[13] == 0){
digitalWrite(storeled, LOW);
}
// FONCTION STORE DANS LA MEMORY SELON LES VALEURS DE VARIABLES
for (byte index = 0; index < 12; index++) {
if (boutons[index] == 1 && boutons[13] == 1) {
memory[1][index] = variableOut - 1;
memory[0][index] = variableIn - 1;
delay(200); // Délai anti-rebond
digitalWrite(storeled, LOW);
delay(100);
digitalWrite(storeled, HIGH);
delay(100);
digitalWrite(storeled, LOW);
delay(100);
digitalWrite(storeled, HIGH);
delay(100);
digitalWrite(storeled, LOW);
delay(100);
digitalWrite(storeled, HIGH);
delay(100);
digitalWrite(storeled, LOW);
delay(100);
}
}
}
void rscommand(){
// FONCTION POUR TRIGGER DE 1 A 12 SELON MEMORY sur les 2 dimensions INPUTS/OUTPUTS
for (byte index = 0; index < 12; index++)
{
byte currentTriggerState = boutons[index];
if (currentTriggerState != lastButtonState[index])
{
lastButtonState[index] = currentTriggerState;
if (currentTriggerState == HIGH && boutons[13] == 0){
{
byte data[] = {0x80,0x80,outs[memory[1][index]],xpt[memory[0][index]]};
byte csm = calculateChecksum(data, sizeof(data));
byte outh = outs[memory[1][index]];
byte xpth = xpt[memory[0][index]];
while (!Serial.availableForWrite());
Serial.println("CMD Hexa : ");
delay(200);
for (int t = 0; t < 17; t++) // ENVOI TX
{
byte cmd[17] = {0x01,0x02,0x00,0x0b,0x01,0x50,0x20,0x00,0x00,0x04,outh,0x00,0x80,0x00,xpth,csm,0x03};
Serial.write (cmd, sizeof(cmd));
}
delay(600);
Serial.println("");
Serial.println("");
Serial.println("CMD Decimale : ");
for (int t = 0; t < 17; t++)
{
byte cmd[17] = {0x01,0x02,0x00,0x0b,0x01,0x50,0x20,0x00,0x00,0x04,outh,0x00,0x80,0x00,xpth,csm,0x03};
Serial.print (cmd[t], HEX);
}
Serial.println("");
Serial.println("- Infos -");
Serial.print("Memory - IN : ");
Serial.print(memory[0][index] + 1);
Serial.print(" OUT : ");
Serial.println(memory[1][index]);
Serial.print("In - decimal : ");
Serial.print(xpth, DEC);
Serial.print(" hexa : ");
Serial.println(xpth, HEX);
Serial.print("Out - decimal : ");
Serial.print(outh, DEC);
Serial.print(" hexa : ");
Serial.println(outh, HEX);
Serial.print("Checksum - decimal : ");
Serial.print(csm, DEC);
Serial.print(" hexa :");
Serial.println(csm, HEX);
Serial.print("Variables - IN : ");
Serial.print(variableIn);
Serial.print(" OUT : ");
Serial.println(variableOut);
Serial.println("");
}
}
}
}
}
void loop() { // Fonctions Display / Store / Variables / TRIGGERS 1 à 12 + write serial
if (millis() - derniereActivation > delaiMax) {
pause = true;
}
for (int index = 0; index < 3; index++)
if (boutons[13 + index] == 1) {
pause = 0;
derniereActivation = millis();
}
triggers();
if (pause == false){
updateDisplay1();
} else {
bootscreen ();
}
compteur();
store();
rscommand();
}
Simulator that helped me when i was not at home (for the actual cable diagram and things i use, but the mux seems not working on wokwi, dunno why becuase it works well irl):
My problem is : I can't see any of the commands sent by the remote into my computer on a RS232 terminal, did i miss something ?
Sorry in advance for all the french words in the code!