Skip to content

Instantly share code, notes, and snippets.

View romilly's full-sized avatar

Romilly Cocking romilly

View GitHub Profile
"""
Example for remote control from host via Serial link.
This is the code to run on the Pico.
It sets up the onboard LED and allows you to turn it on or off.
"""
from machine import Pin
# use onboard LED which is controlled by Pin 25
# on a Pico W the onboad lLED is accessed differently,
import serial
class Talker:
TERMINATOR = '\r'.encode('UTF8')
def __init__(self, timeout=1):
self.serial = serial.Serial('/dev/ttyACM0', 115200, timeout=timeout)
def send(self, text: str):
@romilly
romilly / blog.md
Last active January 26, 2021 09:58

Why I use APL every day

I first met APL (A Programming Language) in 1968.

I've always used it a lot, and now I use it every day.

Many developers will never have heard of the language. Many of those that have, either love it (as I do) or hate it.

I think now is the time to explain what APL is, why I use it so often, and why I think that developers should take a look at it.

@romilly
romilly / ser.py
Last active May 22, 2019 15:03
Real and print lines from a serial input
import serial
with serial.Serial('/dev/ttyACM0', 9600, timeout=10) as ser:
while True:
print(ser.readline())
import feedparser
feed = feedparser.parse('http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml')
print feed['feed']['title']
print len(feed)
@romilly
romilly / keybase.md
Last active August 29, 2015 13:57
Keybase ID Proof

Keybase proof

I hereby claim:

  • I am romilly on github.
  • I am romilly (https://keybase.io/romilly) on keybase.
  • I have a public key whose fingerprint is 878A 89AD 2AC2 E315 1E6C 5398 72CA 4FA2 E7CB 6E36

To claim this, I am signing this object: