Skip to content

Instantly share code, notes, and snippets.

Avatar
🎛️
Bleep bloop

Stargirl Flowers theacodes

🎛️
Bleep bloop
View GitHub Profile
@theacodes
theacodes / main.dart
Created Dec 29, 2022
silent-echo-3373
View main.dart
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
}
@theacodes
theacodes / main.cpp
Created Nov 14, 2021
C++ examples for converting between MIDI notes, frequencies, and Volts/octave
View main.cpp
#include <cstdint>
#include <cmath>
/*
Examples for converting between note numbers, frequencies, and Volts/octave.
If you're unfamiliar with MIDI note numbers, they are integers that
correspond to semitones (half steps). For example, MIDI note 12 is
C1 (16.35 Hz) and MIDI note 24 (twelve half steps higher) is C2 (32.70 Hz).
@theacodes
theacodes / main.dart
Created Nov 27, 2019
AnimatedContainer with FutureBuilder
View main.dart
FutureBuilder(
future: future,
builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
double width;
switch(snapshot.connectionState) {
case ConnectionState.none:
case ConnectionState.waiting:
case ConnectionState.active:
width = 0;
break;
@theacodes
theacodes / winterbloom_voltage_out.py
Created Oct 9, 2019
A helper library to setting a DAC to direct voltage values
View winterbloom_voltage_out.py
# (c) 2019 Alethea Flowers
# Licensed under the MIT license.
"""A helper library to setting a DAC to direct voltage values.
That is, instead of setting a 16-bit integer value you can set the DAC to a
floating-point voltage value.
This requires information about the real-world DAC output and any output
scaling - this is called **calibration** data.
@theacodes
theacodes / winterbloom_ad5689.py
Last active Oct 9, 2019
CircuitPython driver for the AD5689
View winterbloom_ad5689.py
# (c) 2019 Alethea Flowers
# Licensed under the MIT license.
"""A driver for the Analog Devices AD5689(R) 16-bit Digital to Analog Converter.
AD5689 wiring expectations (TSSOP-16 package):
* 1: AD5689 = Vref, AD5689R = NC (uses internal reference)
* 2: NC
* 3: Analog output A
View injector.py
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
View keybase.md

Keybase proof

I hereby claim:

  • I am theacodes on github.
  • I am theacodes (https://keybase.io/theacodes) on keybase.
  • I have a public key ASAYLG-IxCSWNo0Kdev6Z4K60rWKN3-qmJMPSPJ6H_DXpAo

To claim this, I am signing this object:

View what.txt
Write our robot code in Python on the Raspberry Pi.
We'll use the Arduino as a daughterboard. It'll handle I/O.
Use a serial protocol to communicate between the 2.
Raspberry Pi (Python) <-> USB Serial <-> Arduino (Firmware)
How do we get there?
1. Write a Arduino sketch to act as our firmware. This will receive serial commands and send back data.
View vendor.py
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@theacodes
theacodes / nox.py
Created Aug 30, 2016
nox for gcloud-python
View nox.py
def session_test(session):
session.interpreter = 'python2.7'
session.install('-e', '.[grpc]')
session.install('pytest')
session.run('pytest', '-x', 'google')