Skip to content

Instantly share code, notes, and snippets.

/*
Reads a digital input on pin 2, prints the result to the serial monitor
*/
void setup() {
// initialize serial communication at a baud rate of 9600 bits per second:
// this is the rate at which the two machines speaks and listen - of they are ste differently the result is gibberish
Serial.begin(9600);
// set pin 2 to operate as an input form the button:
0x10afa70143dc4f099f729815683327b0f927c81b
0xcaa36B42CE31Bd866Bfc23D76bDCD727DB2D070a
0x68B28E2D3414d4B7e365b8BDBB2B42A136d21912
@psychosophonis
psychosophonis / 2 dimensional colour array
Last active August 24, 2017 06:51
Some code for Meda102 2017
int noIterations = 100;
int degreesRotate = 15;
int size =100;
int circDist = 40;
int [][] rgbValues = new int[3][4];
void setup() {
size(800, 600);
@psychosophonis
psychosophonis / randomCircles.ino
Created January 10, 2016 12:32
Drawing with randomness on our LED screens
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <SPI.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
void setup() {
@psychosophonis
psychosophonis / gist:700e62c34e0962922612
Last active January 10, 2016 12:18
Playing with the ADAfruit GFX Library and OLED
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <SPI.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
void setup() {
@psychosophonis
psychosophonis / countdown.no
Created January 10, 2016 11:03
Decrement With Lights and Reset
#include <Wire.h> // these are all the libraries we need for working with our screen.
#include <SPI.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#define OLED_RESET 4 // here we get the screen ready for sending instructions to using the libraries above
Adafruit_SSD1306 display(OLED_RESET);
int x = 0; // this is an important new step - here we are making a container called X to put a number in.
//this is a container that can only fit integers inside of it - an integer is a whole number (the ones we count with)
@psychosophonis
psychosophonis / IncrementEdge
Created January 10, 2016 07:53
Increment with Edge
#include <Wire.h> // these are all the libraries we need for working with our screen.
#include <SPI.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#define OLED_RESET 4 // here we get the screen ready for sending instructions to using the libraries above
Adafruit_SSD1306 display(OLED_RESET);
int x = 0; // this is an important new step - here we are making a container called X to put a number in.
//this is a container that can only fit integers inside of it - an integer is a whole number (the ones we count with)
@psychosophonis
psychosophonis / Q&A.ino
Created January 10, 2016 07:41
A simple Q&A sketch using an OLED
#include <Adafruit_GFX.h> // these things at the top just load a bunch of libraries we need to run the screen.
#include <SPI.h> // libraries are collections of code that have been written by others so we don't
#include <Wire.h> // don't have to.
#include <Adafruit_SSD1306.h> //we need these for libraries to make our screen easier to use.
#define OLED_RESET 4 // this code resets the display.
Adafruit_SSD1306 display(OLED_RESET); //
void setup() { //remember that anyhting here runs the first time we run the code and only the first time