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
; | |
; Output file in intel hex format with -fI | |
; | |
; wine avrasm2.exe -fI -l test.lst test.asm and; avrdude -c usbtiny -p atmega1284 -U flash:w:test.hex | |
; | |
.nolist | |
.include "./m1284def.inc" | |
.list |
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
/* | |
# Arrangement: atmega16a, isp style protoboard programmer with littlewire kit | |
# Purpose: to help me remember cli flags and values for the avr toolchain | |
sudo avr-gcc -Wall blink.c -mmcu=atmega16a -o blink.o | |
sudo avr-objcopy -O ihex -R .eeprom blink.o blink.hex | |
sudo avrdude -p atmega16 -c usbtiny -U flash:w:blink.hex | |
*/ |
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
! | |
!https://www.emacswiki.org/emacs/MovingTheCtrlKey | |
! | |
!Swap escape and caps lock keys | |
! seems to work | |
! | |
! sourced in ~/.xsession with | |
! xmodmap ~/.xmodmap | |
! | |
remove Lock = Caps_Lock |
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
/* | |
sudo avrdude -b 19200 -c avrisp2 -p m328p -P /dev/ttyACM1 \ | |
-v -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m \ | |
-U flash:w:optiboot_atmega328.hex | |
*/ | |
//modified from Scott Fitzgerald's Blink, which comes with the `sudo apt-get install arduino` | |
void setup() { | |
pinMode(13, 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
/* | |
sudo avr-gcc -Wall ledBlinkSimple.c -mmcu=atmega328p -o ledBlinkSimple.o | |
sudo avr-objcopy -O ihex -R .eeprom ledBlinkSimple.o ledBlinkSimple.hex | |
sudo avrdude -p atmega328p -c avrisp2 -U flash:w:ledBlinkSimple.hex -P /dev/ttyACM0 | |
*/ | |
#define F_CPU 1000000UL //Tell delay.h we're running the default 1 MHz | |
#include <avr/io.h> | |
#include <util/delay.h> |
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
//avr-gcc -Wall blink.c -mmcu=atmega16 -DF_CPU=1000000UL -o blink.o | |
//sudo avr-objcopy -O ihex -R .eeprom blink.o blink.hex | |
//sudo chmod a+rw /dev/ttyS0 #not sure if this matters | |
//sudo avrdude -p atmega16 -c avrisp2 -U flash:w:blink.hex | |
#include <avr/io.h> | |
// define what pins the LEDs are connected to. | |
// in reality, PD6 is really just '6' | |
#define LED PA0 |
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
// EXAMPLES: | |
// | |
// http://localhost:8888/people/chefs/Jimbo?eggs=2&cheese=4 | |
// http://localhost:8888/people/chefs/Jimbo?cheese=4&eggs=2 | |
// http://localhost:8888/people/chefs/Jimbo?cheese=4&eggs=2&bacon=5 | |
// | |
// USAGE: | |
// C:\RestForFree>fsi restForFree.fsx | |
// |
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
//Modified from: http://fsharpforfunandprofit.com/posts/concurrency-actor-model | |
open System | |
let print str = printfn "%A" str | |
let slowWriter msg = | |
msg |> String.iter (fun ch-> | |
Threading.Thread.Sleep(1) | |
Console.Write ch | |
) |
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
//Heavily modified from: https://www.branded3.com/blog/creating-a-simple-http-server-with-f | |
open System; open System.Text; open System.IO; open System.Net | |
//Eliminate .NET line noise | |
type HttpListenerResponse with | |
member me.Close = me.OutputStream.Close | |
member me.WriteAsync str = Encoding.ASCII.GetBytes(s=str) |> me.OutputStream.AsyncWrite | |
type Uri with |
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
#r @"C:\GitHub\FParsec\FParsec.1.0.2\lib\net40-client\FParsecCS.dll" | |
#r @"C:\GitHub\FParsec\FParsec.1.0.2\lib\net40-client\FParsec.dll" | |
open System | |
open FParsec | |
let print s = printfn "%A" s | |
type kvp = { key: String; value: int} |