Aaron DayTee Elce
Published © GPL3+

STEAM Engine Tweet & Alert

Small 1Sheeld-powered Arduino box that tweets when 3D printing is started and e-mails the desk when the Maker area breaks ~54 decibels.

BeginnerFull instructions provided694
STEAM Engine Tweet & Alert

Things used in this project

Story

Read more

Code

Untitled file

Arduino
#define CUSTOM_SETTINGS
#define INCLUDE_TWITTER_SHIELD
#define INCLUDE_MIC_SHIELD
#define INCLUDE_EMAIL_SHIELD

/* Include 1Sheeld library. */
#include <OneSheeld.h>

// Define the analog input pin to measure flex sensor position:

const int flexpin = 0; 

int ledPin = 13;
int ledPin2 = 12;

void setup() 
{ 
  /* Start communication. */
  OneSheeld.begin();
  /* Set the LED pin as output. */
  pinMode(ledPin,OUTPUT);
  pinMode(ledPin2,OUTPUT);
  
} 


void loop() 
{ 
  int doorposition;    // Input from analog pin

  // Flex sensor (and therefore door) position (0 to 1023)
  doorposition = analogRead(flexpin);

  /* Always check the noise level. */
  if(Mic.getValue() > 54)
  {
    /* Turn on the LED. */
    digitalWrite(ledPin2,HIGH);
    Email.send("tlc@cmclibrary.org","TOO LOUD","Hi. It's very loud in here!");
    OneSheeld.delay(3000);
  }
  else 
  {
    /* Turn off the LED. */
    digitalWrite(ledPin2,LOW);
  }

  if(doorposition > 900)
  {
    /* Turn on the LED. */
    digitalWrite(ledPin,HIGH);
    /* Tweet. */
    Twitter.tweet("Someone's 3D printing in the TLC right now!");
    /*wait*/
    OneSheeld.delay(36000);
  }
  else
  {
    /* Turn off the LED. */
    digitalWrite(ledPin,LOW);
  }
  
  delay(500);  // wait 500ms
} 

Printweet & Alert

Works with a flex sensor and a mobile device/1Sheeld to tweet about 3D prints as they happen and keep us aware of noise levels in the library space.

Credits

Aaron Day

Aaron Day

1 project • 1 follower
Librarian & Maker at Cape May County Library in NJ, USA
Tee Elce

Tee Elce

1 project • 1 follower

Comments