Skip to content

Instantly share code, notes, and snippets.

View johnaboxall's full-sized avatar

John Boxall johnaboxall

View GitHub Profile
@johnaboxall
johnaboxall / GraphicsTestOLED.ino
Created August 20, 2019 08:59
Sketch to test I2C 128 x 64 OLED module from PMD Way
// Display > https://pmdway.com/products/0-96-128-64-graphic-oled-displays-i2c-or-spi-various-colors
// Guide > https://pmdway.com/blogs/product-guides-for-arduino/using-the-0-96-128-x-64-graphic-i2c-oled-displays-with-arduino
#include <Arduino.h>
#include <U8x8lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
@johnaboxall
johnaboxall / i2cscanner.ino
Created August 20, 2019 06:32
I2C bus scanner for Arduino
#include <Wire.h>
void setup() {
Wire.begin();
Serial.begin(115200);
Serial.println("\nI2C Scanner");
}
void loop() {
byte error, address;
@johnaboxall
johnaboxall / exampleTFT80160.ino
Created August 20, 2019 01:49
Demo sketch for 0.96" 80 x 160 Full Color IPS LCD Module from PMD Way
// https://pmdway.com/blogs/news/using-the-0-96-80-x-160-full-color-ips-lcd-module-with-arduino
// https://pmdway.com/products/0-96-80-x-160-full-color-lcd-module
#include <UTFT.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];
// Initialize display
// Library only supports software SPI at this time
//NOTE: support DUE , MEGA , UNO
@johnaboxall
johnaboxall / example1-2.ino
Created August 1, 2019 14:41
Example 1-2 - PWM
int i = 1000;
void setup()
{
pinMode(3, OUTPUT); // sets digital pin 3 to an output
pinMode(6, OUTPUT); // sets digital pin 6 to an output
}
void loop()
{
@johnaboxall
johnaboxall / example1-1.ino
Created August 1, 2019 13:01
Example 1-1
int i = 1000;
void setup()
{
pinMode(3, OUTPUT); // sets digital pin 3 to an output
pinMode(6, OUTPUT); // sets digital pin 6 to an output
}
void loop()
{
void setup()
{
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again, forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second