Skip to content

Instantly share code, notes, and snippets.

View chapter0-1.ino
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
View example1-1.ino
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()
{
View example1-2.ino
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 / exampleTFT80160.ino
Created Aug 20, 2019
Demo sketch for 0.96" 80 x 160 Full Color IPS LCD Module from PMD Way
View exampleTFT80160.ino
// 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 / i2cscanner.ino
Created Aug 20, 2019
I2C bus scanner for Arduino
View i2cscanner.ino
#include <Wire.h>
void setup() {
Wire.begin();
Serial.begin(115200);
Serial.println("\nI2C Scanner");
}
void loop() {
byte error, address;
@johnaboxall
johnaboxall / GraphicsTestOLED.ino
Created Aug 20, 2019
Sketch to test I2C 128 x 64 OLED module from PMD Way
View GraphicsTestOLED.ino
// 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 / 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
@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 / 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";
You can’t perform that action at this time.