MaddySean Freese
Published © GPL3+

Daily Quote Machine

We have developed an automatic quote generator using IFTTT and an output of BrainyQuote.

IntermediateWork in progress2 hours252
Daily Quote Machine

Things used in this project

Hardware components

Photon
Particle Photon
×1
Breadboard (generic)
Breadboard (generic)
This was the base of our device and consisted of the Particle, wires, LCD, and Potentiometer.
×1
Jumper wires (generic)
Jumper wires (generic)
These wires allowed us to connect the Particle to the LCD.
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
We used this to adjust the brightness of the LCD.
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
This was used to display the quote of the day or the default "Waiting for quote of the day"
×1

Software apps and online services

Maker service
IFTTT Maker service
BrainyQuote

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
This was used to cut the box designed to fit the device.

Story

Read more

Schematics

Fritzing Diagram

This diagram was used to arrange our wires.
Image 2t892y50ef

Code

Coding For Our Quote Generator

C/C++
Hopefully this will help you understand our thoughts behind our final project.
// This sketch is based on instructions found here: http://blog.jongallant.com/2015/10/particle-photon-lcd-setup/
// The next few lines are to state what we’re using and the general things we need to have happen
#include "application.h"
#include <LiquidCrystal.h>
LiquidCrystal lcd(D0, D1, D2, D3, D4, D5);
SYSTEM_MODE(AUTOMATIC);
// The LCD will show this when there’s no quote or when the quote is loading so the screen is never blank
String content = "Waiting for the quote of the day";
int strLength;
// This gives the dimensions of the LCD
void setup() {
  lcd.begin(16, 2);
// Display Quote is the function being used by particle
  Particle.function("Display Quote", displayQuote);
}
// This loop will allow the quote to scroll and fit on the LCD so it can be read, and will repeat the scrolling automatically. The actually scrolling code is further down
void loop() {
// This says that when the string length is greater than 16 characters, the LCD should use the scrolling function
  strLength = content.length();
  if (strLength > 16) {
    scrollText();
  }
//This part of the code allows the LCD to keep itself from scrolling when the quote is less than 16 characters
  else {
    lcd.home();
    lcd.print(content);
  }
}
boolean displayQuote (String subject) {
  content = subject;
  return true;
}
// This is the breakdown of the code allowing the quote to scroll on the LCD
void scrollText() {
  String onScreen;
  for (int i = 0; i < strLength - 15; i++) {
    lcd.home();
    onScreen = content.substring(i, i + 16);
    lcd.home();
    lcd.print(onScreen);
    delay(750);
  }
}

Credits

Maddy

Maddy

1 project • 0 followers
Contact
Sean Freese

Sean Freese

0 projects • 0 followers
Contact
Thanks to Sean Freese.

Comments

Add projectSign up / Login