Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mikeanthonywild on github.
  • I am mikeanthonywild (https://keybase.io/mikeanthonywild) on keybase.
  • I have a public key ASAxTuG7keAYsntdJ0wF1G-aXK7S_zbEgMpG7jEJq_zUYgo

To claim this, I am signing this object:

@mikeanthonywild
mikeanthonywild / betterthreads.py
Last active December 22, 2021 17:14
betterthreads provides an enhanced replacement for the threading.Thread class geared towards cleanly stopping blocking threads. See http://mikeanthonywild.com/stopping-blocking-threads-in-python-using-gevent-sort-of.html for writeup.
""" betterthreads provides an enhanced replacement for the
threading.Thread class geared towards cleanly stopping blocking
threads.
"""
import gevent
import uuid
from gevent.event import Event
#include <SPI.h>
char buf [100];
volatile byte pos;
volatile boolean process_it;
void setup (void)
{
Serial.begin (115200); // debugging
while(!Serial.available()){} //wait for char