Skip to content

Instantly share code, notes, and snippets.

@shawngrimes
shawngrimes / README.md
Last active March 23, 2020 17:21
STEM Toy Recommendations
@shawngrimes
shawngrimes / Microbit.js
Created July 19, 2018 13:39
Tri-Word Game Microbit game code from MEC Bootcamp 2018 created by Kathy Lane and Shawn Grimes as a prototype activity.
let letter = ""
let timerCounter = 0
//Creates a shake gesture that will display a new letter
input.onGesture(Gesture.Shake, () => {
if (timerCounter < 63) {
//Uncomment one of the below depending on what letters you want added to the microbit
letter = "AEIOUY".charAt(Math.random(6))
//letter = "BCDFGHJKLMNPQRSTVWXZ".charAt(Math.random(18))
//letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.random(25))
import java.util.*;
public class Bills {
public static void main(String[] args) {
double johnBills=0;
double janeBills=0;
Scanner console = new Scanner(System.in);
System.out.print("How much will John be spending? ");
johnBills = getBills();
#include <ESP8266WiFi.h>
#include <Adafruit_MQTT.h>
#include <Adafruit_MQTT_Client.h>
#include "DHT.h"
#define DHTPIN 14 // what digital pin we're connected to
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
DHT dht(DHTPIN, DHTTYPE);
/************************* WiFi Access Point *********************************/
int ledPin=9; //Variable to store pin of LED
int photoPin=A0; //Variable to store pin of potentiometer
int photoValue=0; //Variable to store last known value of potentiometer
int brightnessValue=0; //Variable to store LED brightness
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT); //Setup LED pin for output
}
//This is a basic program to report the value of a photoresistor to the Adafruit.io service.
//These libraries are needed to talk to the Internet and the Adafruit service
#include <YunClient.h>
#include <Adafruit_MQTT.h>
#include <Adafruit_MQTT_Client.h>
int photoPin=A0; //Variable to store pin of photoresistor
float photoValue=0; //Variable to store last known value of photoresistor
#include <YunClient.h>
#include <Adafruit_MQTT.h>
#include <Adafruit_MQTT_Client.h>
int ledPin = 9;
/************************* Adafruit.io Setup *********************************/
#define AIO_SERVER "io.adafruit.com"
#define AIO_SERVERPORT 1883
#include <Process.h>
int ledPin=9; //Variable to store pin of LED
int potentPin=A0; //Variable to store pin of potentiometer
int potentValue=0; //Variable to store last known value of potentiometer
int brightnessValue=0; //Variable to store LED brightness
int moistPin=A1; //Variable to store pin of moisture sensor
int moistValue=0; //Variable to store moisture value
/////////////////
@shawngrimes
shawngrimes / sparkfun.ino
Last active April 9, 2016 05:15
data.sparkfun.com template
#include <Process.h> //Library for Sparkfun network connection
/////////////////////////////////
// Data.SparkFun.Com variables //
////////////////////////////////
// URL to phant server (only change if you're not using data.sparkfun
String phantURL = "http://data.sparkfun.com/input/";
// Public key (the one you see in the URL):
String publicKey = "xxxxxx";
// Private key, which only someone posting to the stream knows
#include <Process.h>
int ledPin=9; //Variable to store pin of LED
int potentPin=A0; //Variable to store pin of potentiometer
int potentValue=0; //Variable to store last known value of potentiometer
int brightnessValue=0; //Variable to store LED brightness
/////////////////
// Phant Stuff //
/////////////////