Giter Site home page Giter Site logo

smartclassroom's Introduction

Smart Classroom

This is a project to hook up an Arduino borad to Twitter using Python. It takes data information from an Aruino in the classroom and tweet to the Twitter account @SheridanS421.

The project is based on pySerial, Python Arduino Prototyping API v2 and Tweepy.

Basic Setup

  1. Go to Twitter Apps to create an app and generate your API tokens if you haven't already
  2. Hook up the Arduino board with the sensors and output devices. This is a example hooking up with a button, a 16 * 2 LCD and a ADXL345 accelerometer: ssketch
  3. Clone this repository or Download ZIP
  4. Paste your Twitter API tokens to tweet.py
  5. Use the Arduino IDE to open the ArduinoAPI.ino under the directory ArduinoAPI
  6. Start from a new .py file under the same directory, and here is a basic template:
from arduino import *
from tweet import *
arduino = Arduino('COM6') // Use the Arduino port
arduino.output([])

Basic Example

Here is a basic example that tweets when someone presses the button:

from tweet import *
from arduino import *

arduino = Arduino('COM6')
arduino.output([])

buttonPin = 8

print "INITIATE"
today = 0
total = 0

while True:
	button = arduino.getState(buttonPin)
	time.sleep(0.1)
	if button:
		today += 1
		total += 1
		tmp = arduino.getTemp()
		arduino.LCD(today, total, int(round(tmp)))
		name = str(raw_input("Who pressed me?! "))
		print tweet(name + " pressed the big red button!")
		time.sleep(1)

It gets the name from user input in the Python console when somebody presses the button and send a tweet with the name.

smartclassroom's People

Contributors

neo avatar

Watchers

James Cloos avatar  avatar

Forkers

andrewsmyk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.