<commit_before>#include "Arduino.h"
#include "Servo.h"
#include "IoT.h"


void defineRele(int pin){
  pinMode(pin, OUTPUT);
}

void ligaRele(int pin){
  digitalWrite(pin, HIGH);
}

void desligaRele(int pin){
  digitalWrite(pin,LOW);
}

void defineLed(int led){
  pinMode(led, OUTPUT);
}

void acendeLed(int pin){
  digitalWrite(pin, HIGH);
}

void apagaLed(int pin){
  digitalWrite(pin, LOW);
}

void brilhaLed(int pin, int brilho){
  analogWrite(pin, brilho);
}

void espera(long time){
  delay(time);
}

void botao(int pin){
  pinMode(pin, INPUT_PULLUP);
}

uint8_t verificaBotao(int pin){
  return digitalRead(pin);<commit_msg>Codigo das funcoes de sensor ultrassonico<commit_after>#include "Arduino.h"
#include "Servo.h"
#include "IoT.h"


void defineRele(int pin){
  pinMode(pin, OUTPUT);
}

void ligaRele(int pin){
  digitalWrite(pin, HIGH);
}

void desligaRele(int pin){
  digitalWrite(pin,LOW);
}

void    defineSensor(int trig, int echo){
   pinMode(trig, OUTPUT);
   pinMode(echo, INPUT);
}
int     calculaDistanciaSensor(int trig, int echo){
   int   distancia;
   long  duracao;
  
   digitalWrite(trig, LOW);
   delayMicroseconds(2);
   digitalWrite(trig, HIGH);
   delayMicroseconds(10);
   digitalWrite(trig, LOW);
  
   duracao = pulseIn(echo, HIGH);
   // Calculating the distance
   distancia= (int)(duracao*0.034/2);
   return distancia;
}

void defineLed(int led){
  pinMode(led, OUTPUT);
}

void acendeLed(int pin){
  digitalWrite(pin, HIGH);
}

void apagaLed(int pin){
  digitalWrite(pin, LOW);
}

void brilhaLed(int pin, int brilho){
  analogWrite(pin, brilho);
}

void espera(long time){
  delay(time);
}

void botao(int pin){
  pinMode(pin, INPUT_PULLUP);
}

uint8_t verificaBotao(int pin){
  return digitalRead(pin);
{'fraction_non_alphanumeric': 0.1383467278989667, 'fraction_numerical': 0.0057405281285878304, 'mean_word_length': 4.771523178807947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '147818', 'n_tokens_mistral': 717, 'n_tokens_neox': 708, 'n_words': 152}