Skip to content

Instantly share code, notes, and snippets.

View ansarid's full-sized avatar

Daniyal Ansari ansarid

  • Texas A&M Engineering Experiment Station
  • College Station, Texas
View GitHub Profile
// Enviromental Managment System
// Pins:
// LCD - 2,3,4,5,6,7
// DHT11/22 - 8
// Sprayer - 9
// Vent Servo - 10
// Fan - 11
// Buzzer - 12
@ansarid
ansarid / on_off_test.ino
Created November 3, 2017 08:13
ON/OFF Toggle Test
int ON_BUTTON = 13;
void setup() {
pinMode(ON_BUTTON, OUTPUT);
}
void loop() {
delay(5000);
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
/***************************************************
This is an example for the TMP006 Barometric Pressure & Temp Sensor
Designed specifically to work with the Adafruit TMP006 Breakout
----> https://www.adafruit.com/products/1296
These displays use I2C to communicate, 2 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
#include <Wire.h>
static uint8_t nunchuck_buf[6]; // array to store nunchuck data,
void setup(){
Serial.begin(115200);
nunchuck_setpowerpins(); // use analog pins 2&3 as fake gnd & pwr
nunchuck_init(); // send the initilization handshake
}
/*
* NunchuckPrint
*
* 2007 Tod E. Kurt, http://todbot.com/blog/
*
* Change log:
*
* Mark Tashiro - Changed Wire.read to Wire.write
* Changed Wire.receive to Wire.read
* Added code for servos
#include <SPI.h>
#include <WiFi.h>
char wifi_name[] = "WI-FI DSTR Data";
char wifi_password[] = "dstrdstr";
unsigned int localPort = 3553; // local port to listen on
WiFiUDP Udp;
char packetBuffer[255]; //buffer to hold incoming packet
char ReplyBuffer[] = "acknowledged"; // a string to send back
@ansarid
ansarid / joystick_serial_packet_assembly.ino
Last active April 13, 2018 05:32
The Joystick Serial Code that Outputs the Proper Packet Format
/*
MATH
Raw Values
int joy_x_axis = nunchuck_buf[0];
int joy_y_axis = nunchuck_buf[1];
@ansarid
ansarid / example.md
Created August 1, 2019 22:04
mjpg_streamer opencv module
sudo apt update
sudo apt install mjpg-streamer-opencv-python

Create filter file. (/home/debian/opencv_filter.py)

import cv2
import numpy as np
@ansarid
ansarid / fix.md
Last active August 26, 2019 06:07
Repair PPTK hand on pptk.view
cd /usr/local/lib/python3.7/dist-packages/pptk/libs
mv libz.so.1 libz.so.1.old
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1

Based off fix at pptk issue #3

@ansarid
ansarid / py_live_db.py
Created September 9, 2019 16:47
Python Heartrate Demo
import heartrate; heartrate.trace(browser=True)
import time
x = 0
while x < 100:
print("Hello World\t", x)
time.sleep(0.1)
x+=1
exit()