Skip to content

Instantly share code, notes, and snippets.

View rlogiacco's full-sized avatar
💭
I may be slow to respond, be patient...

Roberto Lo Giacco rlogiacco

💭
I may be slow to respond, be patient...
View GitHub Profile
@rlogiacco
rlogiacco / WaitingWebDriver
Last active August 29, 2015 14:19
Selenium wait for elements
public class WaitingWebDriver {
private SharedWebDriver browser;
private Class<? extends WebDriver> driver;
@Before
public void before() {
driver = ChromeDriver.class;
System.setProperty(SharedWebDriver.SELENIUM_DRIVER_PROPERTY, driver.getName());
@rlogiacco
rlogiacco / receiver.ino
Last active December 15, 2022 23:36
nRF24 multiple transmitters
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
int senderId;
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
//Contacts from the radio to connect NRF24L01 pinamnam -> Arduino
@rlogiacco
rlogiacco / payload.h
Created July 3, 2014 08:17
Arduino to RaspberryPI communication test with nRF24 chipset and libraries
#ifndef __VIRIDI_NEXU_PAYLOAD__
#define __VIRIDI_NEXU_PAYLOAD__
enum PayloadType {
HERBA, METEO
};
typedef uint8_t vn_payload_type;
typedef uint8_t vn_payload_version;
@rlogiacco
rlogiacco / AnalogAndVoltage.ino
Last active August 29, 2015 14:01
VoltageReference
#include <VoltageReference.h>
VoltageReference vRef;
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Calibrating voltage reference");
vRef.begin();
}
@rlogiacco
rlogiacco / SerialDebug.h
Last active August 29, 2015 13:55
Use the serial connection to debug your sketch
#ifndef __SERIAL_DEBUG
#define __SERIAL_DEBUG
#if SERIAL_DEBUG
#ifndef SERIAL_DEBUG_SEPARATOR
#define SERIAL_DEBUG_SEPARATOR " | "
#endif
#define DEBUG_0() Serial.println("### SerialDebug ###")
@rlogiacco
rlogiacco / LedDebug.h
Last active August 29, 2015 13:55
Use the built in led to debug your sketch in case you don't have access to the device serial
#ifndef __LED_DEBUG
#define __LED_DEBUG
#if LED_DEBUG
#ifndef LED_DEBUG_PIN
#define LED_DEBUG_PIN LED_BUILTIN
#endif
#ifndef LED_DEBUG_DELAY
@rlogiacco
rlogiacco / PingPong.cpp
Last active January 4, 2016 03:59
PingPong nRF24L01+ example for Spark Core using pins 5 CE and 6 CSN
#ifndef Binary_h
#define Binary_h
#define B0 0
#define B00 0
#define B000 0
#define B0000 0
#define B00000 0
#define B000000 0
#define B0000000 0
@rlogiacco
rlogiacco / PingPong.ino
Last active May 6, 2019 19:29
ManiacBug's RF24 library example working on Arduino micro connecting the NRF24L01 module on the Arduino micro pins (not the ICSP header) and pins 9 and 10
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9, 10);
// Radio pipe addresses for the 2 nodes to communicate.
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
@rlogiacco
rlogiacco / Plotter.pde
Created November 28, 2013 23:06
Processing scale aware plotter for Arduino usable as coarse oscilloscope. Two Arduino code examples provided.
// Time Aware Plotter
// License: Creative Commons BY-SA
// This program takes ASCII-encoded strings from the serial port at 9600 baud and graphs them.
// It expects up to 6 comma separated values in the range 0 to 1023 followed by a newline.
// Plotting must be started with a mouse click and can be paused with a mouse click as well.
// Please note: while plotting is stopped serial data is discarded!
import processing.serial.*;