Skip to content

Instantly share code, notes, and snippets.

View azaharafernandezguizan's full-sized avatar

Azahara Fernández Guizán azaharafernandezguizan

View GitHub Profile
@azaharafernandezguizan
azaharafernandezguizan / estacion.ino
Created May 1, 2022 10:20
Ejemplo estación metereológica muy simple
#include <LiquidCrystal.h>
#include <Wire.h>
#include "MAX30105.h"
#include "spo2_algorithm.h"
/* Configuracion leds*/
int ledOnOFf = 48;
int ledGreen_AirSensor = 30;
int ledYellow_AirSensor = 32;
int ledRed_AirSensor = 34;
@azaharafernandezguizan
azaharafernandezguizan / busqueda_y_detalle.js
Created November 25, 2021 09:26
Archivo para utilizar Newman con dos colecciones de Postman
const newman = require('newman');
const fs = require('fs');
const collectionFileRoute = 'micoleccion.json';
const detailFileRoute = 'colecciondetalle.json';
const collectionFileRouteCreated = './sin/micoleccion_sinvariables.json';
const detailFileRouteCreated = './sin/colecciondetalle_sinvariables';
const commonNameForFiles = 'mi_api';
const arrayPropertyName = 'nombreObjetos';
const idPropertyName = 'id';
const variablesNamesToReplace = ['{{variable1}}','{{variable2}}', '{{num_pag}}', '{{num_results}}'];
@azaharafernandezguizan
azaharafernandezguizan / piedra_papel_tijera.js
Created April 18, 2021 14:26
Console and link game and record data
let Cortex = require('./cortex');
let socketUrl = 'wss://localhost:6868';
let user = {
"license":"",
"clientId":"miClientID",
"clientSecret":"miSecret",
"debit":1
}
console.log('created user');
let currentRecord = new Cortex(user, socketUrl);
class GameLogic{
userOption = 2;
machineOption = 2;
responseDict = {
1: "Piedra",
2: "Papel",
3: "Tijera"
};
@azaharafernandezguizan
azaharafernandezguizan / objectexample.json
Created April 18, 2021 14:21
Example of facial expression object
{
"fac": [ "neutral","surprise",0.115789,"neutral",0.0 ],
"sid":"02438940–5a41–4223–8cde-5d1299856cc6",
"time":1612109674.3526
}
@azaharafernandezguizan
azaharafernandezguizan / cortex.js
Created April 18, 2021 14:19
Modified cortex methods
sub(streams){
this.socket.on('open',async ()=>{
await this.checkGrantAccessAndQuerySessionInfo()
this.subRequest(streams, this.authToken, this.sessionId);
this.socket.on('message', (data)=>{
if(this.isRecordToSave){
this.recordSaved.push(JSON.parse(data));
this.numberOfRecords++;
this.isRecordToSave = this.numberOfRecords < 10;
}
#include <LiquidCrystal.h>
#include <Wire.h>
const int rs = 8, en = 11, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int InitialPositionMoveDisplay = 16;
int PositionsToMoveDisplay = 0;
void setup()
{
int airSensorDig = 10;
int airSensorAnalog = 3;
int ppm_AirSensor = 0;
float tension_AirSensor = 0;
bool state_AirSensor = false;
String resultAirSensorPPM = "";
void setup()
{
}
int photoSensorDig = 9;
int photoSensorAnalog = 0;
String resultPhotoSensor = "";
void setup()
{
}
void loop()
@azaharafernandezguizan
azaharafernandezguizan / SPO2sensor.ino
Last active November 21, 2020 14:42
SPO2 sensor code
#include "MAX30105.h"
#include "spo2_algorithm.h"
MAX30105 heartAndOxigenSensor;
uint32_t irBuffer[50]; //infrared LED sensor data
uint32_t redBuffer[50]; //red LED sensor data
int32_t bufferLength; //data length
int32_t spo2; //SPO2 value
int8_t validSPO2; //indicator to show if the SPO2 calculation is valid
int32_t heartRate; //heart rate value