<commit_before>#include <SimpleModbusSlave.h>
#include <Wire.h>
#include "rgb_lcd.h"

rgb_lcd lcd;

const int colorR = 255;
const int colorG = 0;
const int colorB = 0;

int sensorValue = 0;  
int outputValue = 0; 


#define  LED 8  

//////////////// registers of your slave ///////////////////
enum 
{
  ADC_VAL,     
  PWM_VAL,        
  HOLDING_REGS_SIZE
};

unsigned int holdingRegs[HOLDING_REGS_SIZE]; // function 3 and 16 register array
////////////////////////////////////////////////////////////

void setup()
{
    lcd.begin(16, 2);
    lcd.setRGB(colorR, colorG, colorB);
    lcd.print("Receiving from Master...");
  
  modbus_configure(&Serial, 9600, SERIAL_8N2, 1, 2, HOLDING_REGS_SIZE, holdingRegs);
  modbus_update_comms(9600, SERIAL_8N2, 1);
  
  pinMode(LED, OUTPUT);
}

void loop()
{

  modbus_update();
  holdingRegs[ADC_VAL] = analogRead(A0);
  
 digitalWrite(LED, HIGH);
 delay(holdingRegs[PWM_VAL]);
 digitalWrite(LED, LOW);
 delay(holdingRegs[PWM_VAL]);
 
 
 lcd.setCursor(0, 1);
 lcd.print(holdingRegs[PWM_VAL]);
 lcd.print("  "); 
 lcd.setCursor(5, 1);
 lcd.print(holdingRegs[PWM_VAL]>>2); 
 lcd.print("  ");  
 lcd.setCursor(10, 1);
 lcd.print(holdingRegs[PWM_VAL]>>4);
 lcd.print("  "); 


}
<commit_msg>Update RS485_UnoR3_Slave.ino<commit_after>#include <SimpleModbusSlave.h>
#include <Wire.h>
#include "rgb_lcd.h"

rgb_lcd lcd;

const int colorR = 255;
const int colorG = 0;
const int colorB = 0;

#define  LED 8  

//////////////// registers of your slave ///////////////////
enum 
{
  ADC_VAL,     
  PWM_VAL,        
  HOLDING_REGS_SIZE
};

unsigned int holdingRegs[HOLDING_REGS_SIZE]; // function 3 and 16 register array
////////////////////////////////////////////////////////////

void setup()
{
    lcd.begin(16, 2);
    lcd.setRGB(colorR, colorG, colorB);
    lcd.print("Receiving from Master...");
  
  modbus_configure(&Serial, 9600, SERIAL_8N2, 1, 2, HOLDING_REGS_SIZE, holdingRegs);
  modbus_update_comms(9600, SERIAL_8N2, 1);
  
  pinMode(LED, OUTPUT);
}

void loop()
{

  modbus_update();
//  holdingRegs[ADC_VAL] = analogRead(A0);
  
 digitalWrite(LED, HIGH);
 delay(holdingRegs[PWM_VAL]);
 digitalWrite(LED, LOW);
 delay(holdingRegs[PWM_VAL]);
 
 
 lcd.setCursor(0, 1);
 lcd.print(holdingRegs[PWM_VAL]);
 lcd.print("  "); 
 lcd.setCursor(5, 1);
 lcd.print(holdingRegs[PWM_VAL]>>2); 
 lcd.print("  ");  
 lcd.setCursor(10, 1);
 lcd.print(holdingRegs[PWM_VAL]>>4);
 lcd.print("  "); 


}

{'fraction_non_alphanumeric': 0.21440329218106996, 'fraction_numerical': 0.03292181069958848, 'mean_word_length': 2.858730158730159, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '786896', 'n_tokens_mistral': 1029, 'n_tokens_neox': 941, 'n_words': 177}