Skip to content

Instantly share code, notes, and snippets.

View futureshocked's full-sized avatar

Peter Dalmaris futureshocked

View GitHub Profile
@futureshocked
futureshocked / blink.ino
Created January 6, 2020 03:33
This sketch makes an LED connected to pin 9 to blink on and off every 1 sec
@futureshocked
futureshocked / bare_receiver.ino
Created January 6, 2020 00:31
An updated version of bare_receiver.ino to work with newer versions of the RF24 library.
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
class RF24Test: public RF24
{
public: RF24Test(int a, int b): RF24(a,b) {}
};
RF24Test radio(9,10);
@futureshocked
futureshocked / asbsgs_array_ex4.ino
Created October 26, 2019 04:49
Control an LED using an array
/*
* Control an LED using an array, like in example 3, but the
* pattern is configurable.
*
* Create a pattern with LED on and off information in one array,
* and on/off durations in a second array.
*
*
*/
@futureshocked
futureshocked / asbsgs_array_ex2.ino
Created October 26, 2019 04:49
n example of how to create an use an array of chars
/*
* An example of how to create an use an array of chars
* We'll declare an array of 5 chars.
* We'll print the contents in the serial monitor.
*
* The table of ASCII character from https://en.wikipedia.org/wiki/ASCII
* is useful.
*
*/
@futureshocked
futureshocked / asbsgs_array_ex1.ino
Created October 26, 2019 04:48
An example of how to create an use an array of integers
/*
* An example of how to create an use an array of integers
* We'll declare an array of 5 integers.
* We'll print the contents in the serial monitor.
* We'll do some calculations, store the results, and print the results in the serial monitor.
*
*/
int my_integers[6] = {1, 2, 3, 4, 5} ; // We want this array to contain 5 integers,
// so we'll declare it with size 6.
@futureshocked
futureshocked / asbsgs_array_ex3.ino
Created October 26, 2019 04:45
Control an LED using an array.
/*
* Control an LED using an array.
*
* Create a pattern with LED on and off information in one array,
* and on/off durations in a second array.
*
*
*/
const int ledPin = 7;
@futureshocked
futureshocked / 11_decode_I2C_BME280.ino
Last active October 1, 2019 06:08
11. Arduino with BME280 I2C example sketch (Oscilloscopes for Busy People)
/* 11. Arduino with BME280 I2C example sketch
*
* Use this sketch to experiment with the decoding of I2C communication on an oscilloscope.
*
* Connect CH1 of the oscilloscope to SCL.
* Connect CH2 of the oscilloscope to SDA.
*
*
* This sketch was written for Oscilloscopes for Busy People by Peter Dalmaris.
* Find out more at https://techexplorations.com/courses/oscilloscopes/
@futureshocked
futureshocked / 10_3_Decode_UART_packet.ino
Last active October 1, 2019 06:02
10.3. Arduino UART receive/transmit a packet and decode with an oscilloscope demo sketch (Oscilloscopes for Busy People)
/* 11.3. Arduino UART receive/transmit a packet and decode with an oscilloscope demo sketch
*
* Use this sketch to experiment with the decoding of a multi-byte packet
* that is received and transmitted by an Arduino on an oscilloscope.
*
* Use in tandem with the matching Processing sketch
*
* Connect CH1 of the oscilloscope to pin 0 of the Arduino.
* Connect CH2 of the oscilloscope to pin 1 of the Arduino.
*
@futureshocked
futureshocked / 10_1_UART_RX_Counter.ino
Last active October 14, 2019 19:38
10.2. Arduino UART receive/transmit ASCII character and decode with an oscilloscope demo sketch (Oscilloscopes for Busy People)
/* 11.2. Arduino UART receive/transmit ASCII character and decode with an oscilloscope demo sketch
*
* Use this sketch to experiment with the decoding of an ASCII character
* that is received and transmitted by an Arduino on an oscilloscope.
*
* Use in tandem with the matching Processing sketch
*
* Connect CH1 of the oscilloscope to pin 0 of the Arduino.
* Connect CH2 of the oscilloscope to pin 1 of the Arduino.
*
@futureshocked
futureshocked / 10_1_UART_RX_Counter.ino
Last active October 1, 2019 06:03
10.1. Arduino UART receive integer oscilloscope demo sketch (Oscilloscopes for Busy People)
/* 11.1. Arduino UART receive integer oscilloscope demo sketch
*
* Use this sketch to experiment with the decoding of a single
* integer in simplex on an oscilloscope.
*
* Connect CH1 of the oscilloscope to pin 0 of the Arduino.
* Connect CH2 of the oscilloscope to pin 1 of the Arduino.
*
*
* This sketch was written for Oscilloscopes for Busy People by Peter Dalmaris.