Skip to content

Instantly share code, notes, and snippets.

@SchofieChen
SchofieChen / example.txt
Created December 16, 2020 16:20 — forked from endolith/example.txt
Parseval's theorem Python NumPy example
In [1]: n = 10000000
In [2]: x = rand(n)
In [3]: X = fft(x)
In [4]: rms_flat(x)
Out[4]: 0.57731639149367697
In [5]: rms_flat(ifft(X))
@SchofieChen
SchofieChen / gist:8e0a10c1d410c62ebc2f3fdccba38160
Created September 20, 2018 07:25
ADS1256 for Raspberry pi3 B+
Test
@SchofieChen
SchofieChen / Modbus class C#
Last active December 28, 2023 10:16
Modbus class C#
using System;
using System.Collections.Generic;
using System.Text;
using System.IO.Ports;
namespace Modbus_Poll_CS
{
class modbus
{
private SerialPort sp = new SerialPort();
@SchofieChen
SchofieChen / Client
Last active August 20, 2018 14:01
Mqtt Subscribe
import time, signal
import paho.mqtt.client as mqtt
client = None
mqtt_looping = False
class mqtt_client_program():
def __ini__(self,):
pass
def on_connect(self,mq, userdata, rc, _):