Skip to content

Instantly share code, notes, and snippets.

View UlisesGascon's full-sized avatar
😎
Focus on FOSS Projects!

Ulises Gascón UlisesGascon

😎
Focus on FOSS Projects!
View GitHub Profile
@UlisesGascon
UlisesGascon / pptls - Human Choice
Created June 20, 2015 19:32
pptls - Human Choice
// Definimos la eleccion del jugador y Arduino a cero.
String eleccionJugador = "vacio";
// ==== EMPIEZA EL LOOP() ====
void loop (){
// El jugador define su elección a traves de los 5 botones.
if(digitalRead(boton1) == HIGH){
eleccionJugador = "piedra";
}else if(digitalRead(boton2) == HIGH){
@UlisesGascon
UlisesGascon / pptls - Arduino Choice
Created June 20, 2015 20:02
pptls - Arduino Choice
// Definimos la eleccion del jugador y Arduino a cero.
String eleccionArduino = "vacio";
// ==== EMPIEZA EL LOOP() ====
void loop (){
// === ELECCIÓN ARDUINO ===
// la elección de Arduino es un numero al azar entre 1 y 5.
@UlisesGascon
UlisesGascon / pptls - Draw
Created June 20, 2015 20:10
pptls - Draw
// Resolución en caso de empate.
if(eleccionJugador == eleccionArduino){
Serial.print("Empate! "+String(eleccionJugador)+" no gana a "+String(eleccionArduino));
}
@UlisesGascon
UlisesGascon / pptls - While Loop
Created June 20, 2015 20:17
pptls - While Loop
// variable de control de loop while
bool run = true;
// ==== EMPIEZA EL LOOP() ====
void loop (){
// Loop de control
while(run == true){
if(eleccionJugador == eleccionArduino){
Serial.print("Empate! "+String(eleccionJugador)+" no gana a "+String(eleccionArduino));
@UlisesGascon
UlisesGascon / pptls - Debug
Created June 20, 2015 20:25
pptls - Debug
// Parámetros del depurador
#define DEBUGMODE
// ==== EMPIEZA EL SETUP() ====
void setup() {
//Activando la comunicación Serial
Serial.begin(9600);
<?php
add_shortcode( 'posts-list', 'ignacio_posts_list_shortcode' );
function ignacio_posts_list_shortcode( $atts ) {
$defaults = array(
'items' => 3
);
$atts = wp_parse_args( $atts, $defaults );
<form action="" method="POST">
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'New customer', 'fictizia' ); ?></th>
<td>
<input type="text" name="cliente" value=""/>
</td>
</tr>
</table>
/**
* Split a string into chunks of the given size
* @param {String} string is the String to split
* @param {Number} size is the size you of the cuts
* @return {Array} an Array with the strings
*/
function splitString (string, size) {
var re = new RegExp('.{1,' + size + '}', 'g');
return string.match(re);
}
@UlisesGascon
UlisesGascon / control_intervalo.js
Last active October 15, 2015 00:47
BCD-BC - Dependencias y hardware
/*
Arranque y control de la repetición
*/
// Intervalo que arranca la funcion RunIt, y la repite cada x milisegundos en funcion del valor de "intervalMS".
setInterval(runIt, intervalMS);
// Función que controla la ejecucción de todo lo demás
function runIt () {
@UlisesGascon
UlisesGascon / debug_mode.js
Created October 21, 2015 14:20
BPT Arduino
// Modo Debug
if (debugMode) {
console.log("**************");
console.log("Ask($): " + newChange.ask);
console.log("Bid($): " + newChange.bid);
console.log("Last($): " + newChange.last);
console.log("--------------");
console.log("Conversion Rate: "+euroRate);
console.log("Currency selected: "+currency);
console.log("--------------");