Skip to content

Instantly share code, notes, and snippets.

View Thermoflux's full-sized avatar
🏠
Working from home

Thermoflux Thermoflux

🏠
Working from home
  • Hyderabad, India
View GitHub Profile
@Thermoflux
Thermoflux / GeomTest.m
Last active December 28, 2016 20:24
matlab spinning Rectangles
%% Clean
clear GeomTest;
clc;
clf
cla
%%
h2 = figure();
ax1 = axes(h2);
@Thermoflux
Thermoflux / mex_hello.c
Created January 3, 2017 07:08 — forked from tobbe11/mex_hello.c
Matlab
#include "mex.h"
void
mexFunction (int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[])
{
mexPrintf ("Hello, World!\n");
mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs);
}
@Thermoflux
Thermoflux / tictactoe.m
Created January 3, 2017 07:11 — forked from leegao/tictactoe.m
TicTacToe matlab
function [] = tictactoe()
% Setup the figure/windows for the game
close all
figure('Name','Tic Tac Toe');
plot(-1. -1)
axis([0 3 0 3])
set(gca,'xTick',0:3)
set(gca,'yTick',0:3)
set(gca,'xTickLabel','')
set(gca,'yTickLabel','')
name = "Histogram of US"
extn = ".jpeg"
name = paste(name,extn)
jpeg(name)
par(mfrow=c(3, 1))
for (i in c(1,3)) {
@Thermoflux
Thermoflux / dataLogger.pde
Created March 8, 2017 14:01
Read Serial Data and save to txt file
import processing.serial.*;
Serial mySerial;
PrintWriter output;
void setup() {
mySerial = new Serial( this, Serial.list()[1], 9600 );
println(Serial.list());
output = createWriter( "data.txt" );
}
@Thermoflux
Thermoflux / ReadTemp2.ino
Created March 8, 2017 14:03
Read DHT11 Sensor and output to Serial line
#include <Adafruit_Sensor.h>
// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
#include "DHT.h"
#define DHTPIN 8 // what digital pin we're connected to
// Uncomment whatever type you're using!
@Thermoflux
Thermoflux / getTempHumData.py
Last active March 10, 2022 21:15
This script periodically polls the DHT11 sensor for Temperature and humidity data, logs it locally to a csv file and also sends the data to ThingSpeak.
"""
Humidity and Temperature data logging script.
For ANLY 510 class
Anurag Kotha
Based on below sketch.
Temperature/Humidity Light monitor using Raspberry Pi, DHT11, and photosensor
Data is displayed at thingspeak.com
2015/06/15
SolderingSunday.com
ind = [1,2,4,5,8,9,16,17,18,19,20];
AllData.TextscanFormats(ind) = {'%C'};
dTemp.TextscanFormats(ind) = {'%C'};
h=figure;histogram(gather(Data.CreatedOn));
saveas(h,'CreatedOn_AllData.fig');
h=figure;histogram(gather(Data.FileTime));
saveas(h,'FileTime_AllData.fig');
Iterm = Data.TerminalCode == 1004;
D = gather(Data(Iterm,:));
D = D(D.ProductCode == 24,:);
clearvars;
DataPath = 'C:\*.csv';
PDataPath = 'C:\PData';
%%
AllData = datastore(DataPath,'TreatAsMissing','NA');