Skip to content

Instantly share code, notes, and snippets.

View Marzogh's full-sized avatar
🏔️
Off the grid - as much as possible

Marzogh Marzogh

🏔️
Off the grid - as much as possible
View GitHub Profile
@crcastle
crcastle / ESP8266-nRF24L01.ino
Created September 23, 2015 06:38
Using an Adafruit Huzzah ESP8266 with nRF24L01+ as a (one-way) internet gateway for several nRF24L01+ sensor nodes
#include <SPI.h>
#include <RF24Network.h>
#include <RF24.h>
#include <ESP8266WiFi.h>
const char* ssid = "ssid";
const char* password = "password";
const char* host = "coolapp.herokuapp.com";
@crcastle
crcastle / ESP8266 Code (RX node)
Created July 13, 2015 01:14
Resolution of issue with ESP8266 described in https://gist.github.com/crcastle/93ebe3b42f3ab021639b (see comments for detailed changes)
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define DEVICE_ID 2
#define CHANNEL 1 //MAX 127
// SPI pin configuration figured out from here:
// http://d.av.id.au/blog/esp8266-hardware-spi-hspi-general-info-and-pinout/
RF24 radio(2, 15); // Set up nRF24L01 radio on SPI bus plus pins 2 for CE and 15 for CSN
@ajfisher
ajfisher / _Ping I2C Johnny Five backpack.md
Last active March 24, 2021 16:20
Building an I2C backpack for HC-SR04 ultrasonic sensor

Building an ultrasonic sensor backpack

Note: This is a bit of a scratch to see what's involved in getting the ping sensor to work as an I2C backpack.

Acknowledgements

Dependencies.

@tkojitu
tkojitu / HowToUseStructInArduino.cxx
Created February 19, 2012 01:46
How to use struct in Arduino
struct Control {
int pin;
};
void ctrlPinMode(void* control, int mode) {
Control* ctrl = (Control*)control;
pinMode(ctrl->pin, mode);
}
int ctrlDigitalRead(void* control) {
@jimsynz
jimsynz / rgb_spectrum.c
Created January 5, 2011 20:59
Arduino sketch to cycle an RGB LED through the colour spectrum.
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
void setup() {
// Start off with the LED off.
setColourRgb(0,0,0);
}
void loop() {