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
import logging | |
import sqlite3 | |
import sys | |
import time | |
import json | |
from sense_hat import SenseHat | |
from re import findall | |
from subprocess import check_output |
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
public void FtpRequest(string ftpPath, string destPath) | |
{ | |
// Get the object used to communicate with the server. | |
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpPath); | |
request.Method = WebRequestMethods.Ftp.DownloadFile; | |
// This example assumes the FTP site uses anonymous logon. | |
request.Credentials = new NetworkCredential(userName, passWord); | |
FtpWebResponse response = (FtpWebResponse)request.GetResponse(); |
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
@{ | |
ViewBag.Title = "Plot"; | |
} | |
<h3>Time Based Plot </h3> | |
<div> | |
<cpanel class="plotControls"> | |
<input class="btn btn-default" id="btnGetData" type="button" value="Plot" /> |
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
/// <summary> | |
/// get temperature data starting at time and continuing for span with given period | |
/// </summary> | |
/// <param name="time">time in seconds</param> | |
/// <param name="span">length of span in seconds</param> | |
/// <param name="period"></param> | |
/// <returns>JsonResult containing view model</returns> | |
public JsonResult Get(double time, double span, int period) | |
{ | |
var data = tempRepo.GetSamplesFromSpan(time, span, period); |
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
import spidev | |
import time | |
import os | |
import json | |
import sqlite3 | |
import sys | |
# Open SPI bus | |
spi = spidev.SpiDev() | |
spi.open(0,0) |
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
import spidev | |
import time | |
import os | |
import json | |
# Open SPI bus | |
spi = spidev.SpiDev() | |
spi.open(0,0) | |
# Function to read SPI data from MCP3008 chip |