Skip to content

Instantly share code, notes, and snippets.

@johnaboxall
johnaboxall / 14201491-oled-TCA9548A
Created Oct 26, 2019
Using TCA9548A with OLED on Arduino
View 14201491-oled-TCA9548A
// Display - https://pmdway.com/collections/oled-displays/products/0-49-64-x-32-white-graphic-oled-i2c
// Guide - https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-the-0-49-64-x-32-graphic-i2c-oled-display-with-arduino
// TCA9548A - https://pmdway.com/blogs/product-guides-for-arduino/using-the-tca9548a-1-to-8-i2c-multiplexer-breakout-with-arduino
#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>
void TCA9548A(uint8_t bus)
{
View tca9548a-oled-bmp180.ino
// Display - https://pmdway.com/collections/oled-displays/products/0-49-64-x-32-white-graphic-oled-i2c
// Guide - https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-the-0-49-64-x-32-graphic-i2c-oled-display-with-arduino
// TCA9548A - https://pmdway.com/blogs/product-guides-for-arduino/using-the-tca9548a-1-to-8-i2c-multiplexer-breakout-with-arduino
// BMP180 - https://pmdway.com/collections/altitude-sensors/products/bmp180-barometric-pressure-sensor-board
// BMP180 library - https://github.com/adafruit/Adafruit-BMP085-Library
#include <Arduino.h>
#include <U8g2lib.h>
#include <Adafruit_BMP085.h>
#include <Wire.h>
@johnaboxall
johnaboxall / 14201491-049-OLED.ino
Created Oct 10, 2019
Demonstration sketch for 0.49" OLED
View 14201491-049-OLED.ino
// Display - https://pmdway.com/collections/oled-displays/products/0-49-64-x-32-white-graphic-oled-i2c
// Guide - https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-the-0-49-64-x-32-graphic-i2c-oled-display-with-arduino
#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>
U8G2_SSD1306_64X32_1F_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
void setup() {
@johnaboxall
johnaboxall / data-rx.ino
Created Aug 29, 2019
Data receiver sketch
View data-rx.ino
// data receiver sketch
//
// https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-long-range-315mhz-rf-wireless-transceivers-with-arduino
//
//
#include <VirtualWire.h>
// use onboard LED for status
const int ledPin = 13;
@johnaboxall
johnaboxall / data-tx.ino
Created Aug 29, 2019
Data transmitter sketch
View data-tx.ino
// data transmitter sketch
//
// https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-long-range-315mhz-rf-wireless-transceivers-with-arduino
//
//
#include <VirtualWire.h>
// use onboard LED for status
const int ledPin = 13;
@johnaboxall
johnaboxall / remoterx.ino
Created Aug 29, 2019
Remote control receiver sketch
View remoterx.ino
// receiver sketch
//
// https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-long-range-315mhz-rf-wireless-transceivers-with-arduino
//
#include <VirtualWire.h>
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
void setup()
{
vw_set_ptt_inverted(true); // Required for RF link modules
@johnaboxall
johnaboxall / remotetx.ino
Created Aug 29, 2019
Remote control transmitter sketch
View remotetx.ino
// transmitter sketch
//
// https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-long-range-315mhz-rf-wireless-transceivers-with-arduino
//
#include <VirtualWire.h>
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
const char *on2 = "a";
const char *off2 = "b";
const char *on3 = "c";
@johnaboxall
johnaboxall / transmittertest.ino
Last active Aug 29, 2019
VirtualWire transmitter test sketch
View transmittertest.ino
// transmitter.ino
//
// https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-long-range-315mhz-rf-wireless-transceivers-with-arduino
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@airspayce.com)
// Copyright (C) 2008 Mike McCauley
@johnaboxall
johnaboxall / receivertest.ino
Last active Aug 29, 2019
VirtualWire receiver test sketch
View receivertest.ino
// receiver.ino
//
// https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-long-range-315mhz-rf-wireless-transceivers-with-arduino
//
// Simple example of how to use VirtualWire to receive messages
// Implements a simplex (one-way) receiver with an Rx-B1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@airspayce.com)
// Copyright (C) 2008 Mike McCauley
@johnaboxall
johnaboxall / traffic.ino
Created Aug 21, 2019
Arduino-controlled traffic lights
View traffic.ino
// from https://pmdway.com/blogs/arduino-projects/fun-with-arduino-controlled-traffic-lights
//
// define the I/O pins that are used on the Arduino
// ... the buttons
#define westButton 5
#define eastButton 12
// the LEDs on the traffic light modules
#define westRed 4
#define westYellow 3
You can’t perform that action at this time.