<commit_before>// ask_transmitter.pde
// -*- mode: C++ -*-
// Simple example of how to use RadioHead to transmit messages
// with a simple ASK transmitter in a very simple way.
// Implements a simplex (one-way) transmitter with an TX-C1 module

#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile

// Includes
#define NO_PORTB_PINCHANGES // PortB used for mySofwareSerial
#include <PinChangeInt.h> // From https://github.com/GreyGnome/PinChangeInt

// Port definition

#define     A_PIN  2 // Linear encoder one
#define     B_PIN  3 // Linear encoder other one
#define RESET_PIN  4 // Linear encoder absolute reference
#define   LED_PIN 13 // Built-in led
const int   POT_PIN = A0; // Potentiometer
const int LINE_TENSION_PIN = A1; // For line tension measurement


RH_ASK driver(4800, 11, 12);
//Transmitter : ATAD D12

uint8_t data[4];  // 2 element array of unsigned 8-bit type, holding Joystick readings

// Define global variables to deal with encoder interrupt
volatile unsigned long threshold = 1000;// 'threshold' is the De-bounce Adjustment factor for the encoder. halfSteps
volatile unsigned long int0time = 0;
volatile unsigned long int1time = 0;
volatile uint8_t int0signal = 0;
volatile uint8_t int1signal = 0;
volatile uint8_t int0history = 0;
volatile uint8_t int1history = 0;
// 'halfSteps' is the counter of half-steps. The actual
// number of steps will be equal to halfSteps / 2
volatile long halfSteps = 0;
long halfStepsCorrection = -127; //to get out of range value
boolean isAbsoluteReferenceAvailable = false;

#define FEEDBACK_RATE_ms 50
long last_sent_ms = 0;

void setup()
{
    Serial.begin(9600);	  // Debugging only
    if (!driver.init())
         Serial.println("init failed");
    data[0] = 127;
    data[1] = 127;
    data[2] = 0;
    data[3] = 127;
 <commit_msg>Change pin for easier wiring on arduino nano<commit_after>// ask_transmitter.pde
// -*- mode: C++ -*-
// Simple example of how to use RadioHead to transmit messages
// with a simple ASK transmitter in a very simple way.
// Implements a simplex (one-way) transmitter with an TX-C1 module

#include <RH_ASK.h>
#include <SPI.h> // Not actually used but needed to compile

// Includes
#define NO_PORTB_PINCHANGES // PortB used for mySofwareSerial
#include <PinChangeInt.h> // From https://github.com/GreyGnome/PinChangeInt

// Port definition

#define         A_PIN  2 // Linear encoder one
#define         B_PIN  3 // Linear encoder other one
#define     RESET_PIN  4 // Linear encoder absolute reference
#define  DATA_OUT_PIN  5 // RF module ATAD pin
#define   LED_PIN 13 // Built-in led
const int   POT_PIN = A7; // Potentiometer
const int LINE_TENSION_PIN = A6; // For line tension measurement


RH_ASK driver(4800, 11, DATA_OUT_PIN);
//Transmitter : ATAD D12

uint8_t data[4];  // 2 element array of unsigned 8-bit type, holding Joystick readings

// Define global variables to deal with encoder interrupt
volatile unsigned long threshold = 1000;// 'threshold' is the De-bounce Adjustment factor for the encoder. halfSteps
volatile unsigned long int0time = 0;
volatile unsigned long int1time = 0;
volatile uint8_t int0signal = 0;
volatile uint8_t int1signal = 0;
volatile uint8_t int0history = 0;
volatile uint8_t int1history = 0;
// 'halfSteps' is the counter of half-steps. The actual
// number of steps will be equal to halfSteps / 2
volatile long halfSteps = 0;
long halfStepsCorrection = -127; //to get out of range value
boolean isAbsoluteReferenceAvailable = false;

#define FEEDBACK_RATE_ms 50
long last_sent_ms = 0;

void setup()
{
    Serial.begin(9600);	  // Debugging only
    if (!driver.init())
         Serial.println("init failed");
    data[0] = 127;
    data[1] = 127;
    data[2] = 0;
    data[3] = 127;
 
{'fraction_non_alphanumeric': 0.09306666666666667, 'fraction_numerical': 0.036, 'mean_word_length': 3.5301932367149758, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '4133229', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1163, 'n_words': 452}