Arthur Lorencini Bergamaschi
Published © Apache-2.0

Photweet - Reading your Tweets on OLED Display using Photon

If you are bored and there's nothing else to do during the lockdown period, this project is really a easy way to spend time and learn skills

BeginnerWork in progress1 hour9
Photweet - Reading your Tweets on OLED Display using Photon

Things used in this project

Hardware components

Photon
Particle Photon
×1
Adafruit ssd oled spi display 7 pins ssd1306
It comes inside the "Maker kit" by Particle
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Twitter service
IFTTT Twitter service
Link your services
Particle Build Web IDE
Particle Build Web IDE
Build and flash code on browser.
particle ifttt

Story

Read more

Schematics

wiring schematic

Wiring

Use kicad 5, please.

project library

Code

Photon's code.

Arduino
You can flash it online (https://build.particle.io/build/) or build it local by using Particles workbench and VSCode (https://www.particle.io/workbench/)
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_SSD1306.h>

/*****************************************************************************
NOTE: This code example requires the Adafruit_SSD1306 library to be included,
so make sure to add it via the Libraries tab in the left sidebar.
https://docs.particle.io/tutorials/hardware-projects/maker-kit/
******************************************************************************/

// use hardware SPI
#define OLED_DC     D3
#define OLED_CS     D4
#define OLED_RESET  D5
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
int  x, minX; // variables for scrolling code
String newMessage = "bom dia, twitter", oldMessage;

void setup()   {
  display.begin(SSD1306_SWITCHCAPVCC);
  Particle.variable("message", newMessage);
  Particle.function("input", inputMessage);
  display.setTextSize(4);       // text size
  display.setTextColor(WHITE); // text color
  display.setTextWrap(false); // turn off text wrapping so we can do scrolling
  x    = display.width(); // set scrolling frame to display width
  minX = -1500; // 630 = 6 pixels/character * text size 7 * 15 characters * 2x slower
}

void loop() {

  // this code displays the next bus times on the OLED screen with fancy scrolling
  display.clearDisplay();
  display.setCursor(x/2, 7);
  display.print(newMessage);
  display.display();
  if(--x < minX) x = display.width()*2;
}

int inputMessage(String message){
    newMessage = message;
}

Credits

Arthur Lorencini Bergamaschi

Arthur Lorencini Bergamaschi

2 projects • 1 follower
"If you live each day as if it was your last, some day you'll most certainly be right."

Comments

Add projectSign up / Login