Skip to content

Instantly share code, notes, and snippets.

View phsheth's full-sized avatar

Pushkar Sheth phsheth

View GitHub Profile
@phsheth
phsheth / light_ds3231rtc_lcd.ino
Last active December 21, 2022 22:05
Arduino code for DS3231 RTC, photo resistor and 16x2 LCD
// Include LCD Library Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Include the DS3231 RTC Library
#include <DS3231.h>
//Photoresistor Pin
int lightPin = 0;
@phsheth
phsheth / readarduinoserial.ipynb
Last active January 28, 2018 17:17
Read Arduino serial port data using Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>dtop.csv Light Sensor Data Plot | Pushkar Sheth</title>
</head>
<body>
<img src="https://www.dropbox.com/s/yadadadahiddenfolder/dtop.png?raw=1" alt="dtop Update">
</div>
from pylab import *
import smtplib
templog = "dtop.csv"
def main():
dataupload_gs()
return 0
def dataupload_gs():
from apiclient.discovery import build
void setup() {
// put your setup code here, to run once:
Serial.begin(19200);
}
void loop() {
// put your main code here, to run repeatedly:
//Voltage
from flask import Flask, make_response, request
import io
import csv
import numpy as np
import pandas as pd
app = Flask(__name__)
def transform(text_file_contents):
return text_file_contents.replace("=", ",")
from flask import Flask, make_response, request
import io
import csv
import numpy as np
import pandas as pd
app = Flask(__name__)
def transform(text_file_contents):
return text_file_contents.replace("=", ",")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from wtforms import Form, FloatField, validators, StringField, SelectField
from siggen import check_starttime_float, check_endtime_float, check_starttime, check_endtime
class siggen_InputForm(Form):
signame = StringField(label='Signal Name',
validators=[validators.InputRequired()])
starttime = FloatField(label = 'Start Time [sec]',
default = 0.0,
validators = [validators.InputRequired(), check_starttime_float, check_starttime])
endtime = FloatField(label = 'End Time [sec]',