This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --------------------------------------------------------------- */ | |
/* r/c calculator scripting */ | |
/* ----------------------------------------------------------------*/ | |
var closest_val; // closest value so far | |
var closest_diff = 1000000.00; // diff of val and target | |
var closest = []; // array detailing values of components | |
var ser_par_config = []; // array detailing serial/parallel | |
var outputStr = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// More API functions here: | |
// https://github.com/googlecreativelab/teachablemachine-community/tree/master/libraries/image | |
let model, webcam, labelContainer, maxPredictions; | |
// Load the image model and setup the webcam | |
async function init() { | |
const URL = "https://teachablemachine.withgoogle.com/models/uSXPV8Y2/"; | |
const modelURL = URL + 'model.json'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float R1 = 10000; // resistance value of the fixed resistor | |
float RT; // resistance value of thermistor | |
float T; // final temperature value | |
int therm_val; // where you will store the value from analogRead() | |
// get the value | |
/* INSERT CODE HERE TO RETRIEVE THE ANALOG VALUE & STORE IT IN therm_val */ | |
// this is the math equation for computing the resistance of thermistor | |
RT = R1 * (1023 - therm_val) / therm_val; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Liquid Crystal | |
The LCD circuit: | |
* LCD RS pin to digital pin 7 | |
* LCD Enable pin to digital pin 8 | |
* LCD D4 pin to digital pin 9 | |
* LCD D5 pin to digital pin 10 | |
* LCD D6 pin to digital pin 11 | |
* LCD D7 pin to digital pin 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MPU6050 IMU starter code | |
// include necessary files for MPU6050 | |
#include <Adafruit_MPU6050.h> | |
#include <Adafruit_Sensor.h> | |
#include <Wire.h> | |
// declare MPU6050 object | |
Adafruit_MPU6050 mpu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic demo for IR remote/receiver | |
// include IR remote library | |
#include <IRremote.h> | |
// define pin and declare object | |
#define IR_RCVR_PIN 11 | |
IRrecv irrecv(IR_RCVR_PIN); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// servoMove - can use this instead of servo.write | |
// function to easily move servo at any speed | |
// end_pos - position you would like to move the servo to | |
// ms_deg - how many milliseconds per degree (inverse speed) | |
// * can't move faster than 2 ms per degree | |
// * typically range from 2 (fast) to 50 (slow) | |
// Exp: servoMove(0, 2); | |
void servoMove(Servo _servo, int end_pos, int ms_deg) { | |
// get current position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Activity 00 - Blinky | |
Turns LED on for one second, then off for one second, repeatedly. | |
Sends a serial message indicating whether LED is "on" or "off". | |
Uses onboard LED connected to pin 13. | |
*/ | |
#define LED_PIN 13 // define LED pin | |
// put your setup code here, to run once: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get most recent gmail subject line | |
import sys | |
import imaplib | |
import email | |
import email.header | |
EMAIL_ACCOUNT = "[email protected]" | |
ACCOUNT_PW = "" | |
EMAIL_FOLDER = "INBOX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Activity 01 - Random Blinky | |
Blinks LED chaotically based on a random number. | |
Uses onboard LED connected to pin 13. | |
*/ | |
#define LED_PIN 13 // define LED pin | |
// put your setup code here, to run once: | |
void setup() { |
OlderNewer