Skip to content

Instantly share code, notes, and snippets.

@pyeseul
pyeseul / index.js
Created February 20, 2018 08:47
Final Project for Connected Devices: Working in progress
/*
This code is written by Yeseul Song on top of Tom Igoe's ADSx15 example described below.
*/
/*
Potentiometer and temperature sensor reader for
ADS1x15 analog-to-digital converter on Raspberry Pi.
This script reads two analog sensors through
a Texas Instruments ADS1x15 ADC. Channel 1 has a potentiometer attached,
@pyeseul
pyeseul / app.js
Created February 5, 2018 08:37
Simple webpage using RESTful API + Express.js
var express = require('express');
var bodyParser = require('body-parser');
var path = require('path');
var app = express();
// Body Parser Middleward
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
@pyeseul
pyeseul / index.html
Created February 5, 2018 08:36
Simple webpage using RESTful API + Express.js
<!DOCTYPE html>
<html>
<head>
<title>Week1</title>
</head>
<body style = "font-size: 30pt;">
<h2>MIND READER</h2>
<p>
<form method="GET" action="/numguess">
Pick a number between 0 and 10. <br/>
@pyeseul
pyeseul / index.js
Last active October 25, 2017 00:38
Alexa Skill "Diary"
'use strict';
const Alexa = require('alexa-sdk');
const APP_ID = undefined;
const SKILL_NAME = 'Diary';
const GET_FACT_MESSAGE = "I remember the day.";
const HELP_MESSAGE = 'Alexa is on the floor everyday and she remembers everything she has seen and heard. Ask her what happened on the floor on a certain day.';
const WELCOME_MESSAGE = 'Alexa is on the floor everyday and she remembers everything she has seen and heard. Ask her what happened on the floor on a certain day.';
'use strict';
const Alexa = require('alexa-sdk');
const APP_ID = undefined;
const SKILL_NAME = 'Wording Train';
const GET_FACT_MESSAGE = "Okay! ";
const HELP_MESSAGE = 'Play a word game with your Alexa. The rule is very simple. You and Alexa will take turns to say a word which is starting with the last character of a previous word.';
const HELP_REPROMPT = 'What can I help you with?';
Table table;
int rowCount = 0;
int fillColor;
float cellSize = 10;
void setup() {
size(80, 2700);
table = loadTable("binary_data.csv", "header");
for (TableRow row : table.rows()){
String binary_num = row.getString("binary");
/*
VAR INIT FOR GYRO
*/
#include <Wire.h>
// Register names according to the datasheet.
// According to the InvenSense document
// "MPU-6000 and MPU-6050 Register Map
// and Descriptions Revision 3.2", there are no registers
// at 0x02 ... 0x18, but according other information
// receive a serial value (gyroX) from Arduino to save to the variable below (left)
var left = -7;
var right = -left;
function setup() {
createCanvas(400, 400);
stroke(0);
angleMode(DEGREES);
// MPU-6050 Accelerometer + Gyro
// -----------------------------
//
// By arduino.cc user "Krodal".
//
// June 2012
// first version
// July 2013
// The 'int' in the union for the x,y,z
// changed into int16_t to be compatible
Var express = require('express');
var app = express();
app.get('/test', function (req, res) {
console.log('test');
});
app.listen(3000);