Skip to content

Instantly share code, notes, and snippets.

View alvesoaj's full-sized avatar

AJ Alves alvesoaj

View GitHub Profile
@alvesoaj
alvesoaj / arduino_advanced_sample.ino
Created March 1, 2019 12:56
Advanced Sample of eFFL with Arduino
#include <Fuzzy.h>
// For scope, instantiate all objects you will need to access in loop()
// It may be just one Fuzzy, but for demonstration, this sample will print
// all FuzzySet pertinence
// Fuzzy
Fuzzy *fuzzy = new Fuzzy();
// FuzzyInput
@alvesoaj
alvesoaj / arduino_simple_sample.ino
Last active June 23, 2021 13:35
Simple Sample of eFLL with Arduino
#include <Fuzzy.h>
// Instantiating a Fuzzy object
Fuzzy *fuzzy = new Fuzzy();
void setup()
{
// Set the Serial output
Serial.begin(9600);
// Set a random seed
// Tests file: person-test.cpp
#include "Person.h"
#include "gtest/gtest.h"
#include "string"
using std::string;
TEST(Person, testNameMethods)
{
string name = "AJ O. Alves";
/*
Implementation of Person class: Person.cpp
*/
#include "Person.h"
Person::Person(){};
void Person::setName(string name){
this->name = name;
/*
Definition on Person class: Person.h
*/
#ifndef PERSON_H
#define PERSON_H
#include "string"
using std::string;
class Person
// Arquivo de testes: pessoa-teste.cpp
#include "Pessoa.h"
#include "gtest/gtest.h"
#include "string"
using std::string;
TEST(Pessoa, testarMetodosParaNome)
{
string nome = "AJ O. Alves";
/*
Implementação da classe Pessoa: Pessoa.cpp
*/
#include "Pessoa.h"
Pessoa::Pessoa(){};
void Pessoa::setNome(string nome)
{
/*
Definição da classe Pessoa: Pessoa.h
*/
#ifndef PESSOA_H
#define PESSOA_H
#include "string"
using std::string;
class Pessoa
@alvesoaj
alvesoaj / test_nrf24l01_nodemcu_receiver.ino
Created August 12, 2018 14:42
To test NodeMCU as a receiver, conected with nRF24L01
/*
* AJ Alves (aj.alves@zerokol.com)
*/
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
// Instantiate RF24 class with CE and CSN values
RF24 radio(2, 15);
@alvesoaj
alvesoaj / nrf24l01-receiver-test.ino
Last active October 6, 2021 04:59
Code to test nRF24L01 with Arduino (Receiver)
/*
* AJ Alves (aj.alves@zerokol.com)
*/
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
// Instantiate RF24 class with CE and CSN values
RF24 radio(9, 10);