Skip to content

Instantly share code, notes, and snippets.

View TorstenC's full-sized avatar

Torsten C. TorstenC

View GitHub Profile
@TorstenC
TorstenC / display.h
Last active August 29, 2015 14:10
Arrays für das 24h Wordclock Mock-up aus den Tabellen für 18 x 16
// Mock-up arrays for 24h Wordclock, see http://www.mikrocontroller.net/articles/WordClock24h
// Von-Neumann-Variant, Data from WC24h_18x16_08-19,28.Jan.2015, CodeGen v0.11
// Code-Generator see https://gist.github.com/TorstenC/aec0724be4afcd1d7545
#define DisplayX 18 // deprecated
#define WC_COLUMNS 18
#define DisplayY 16 // deprecated
#define WC_ROWS 16
struct WordIllu {
@TorstenC
TorstenC / CodeGen.cs
Last active August 29, 2015 14:10
C-Code-Generator für die 24h Wordclock
protected override Boolean GenCode() {
string Version = "v0.4";
// // generated code see https://gist.github.com/TorstenC/c45751a699af50fe9e64
FileItem tables_h = this.Files.AppendFile("tables.h");
// Konstanten (werdem am Ende gesetzt) =======================================
CodeBlockItem HeaderT = tables_h.AddCodeBlock("HeaderT");
CodeLine.Add(HeaderT, "// Arrays for 24h Wordclock, see http://www.mikrocontroller.net/articles/WordClock24h");
CodeLine.Add(HeaderT, "// Von-Neumann-Variant, Data from " + this.ClockData.Name + " CodeGen " + Version);
CodeLine.Add(HeaderT, "// Code-Generator see https://gist.github.com/TorstenC/aec0724be4afcd1d7545");
CodeBlockItem ConstantsT = tables_h.AddCodeBlock("Constants");
@TorstenC
TorstenC / tables.h
Last active August 29, 2015 14:10
Arrays aus den Tabellen der 24h Wordclock 18 x 16
// Word-Arrays for 24h Wordclock, see http://www.mikrocontroller.net/articles/WordClock24h
// Von-Neumann-Variant, Data from WC24h_18x16_08-19,28.Jan.2015 CodeGen v0.12
// Code-Generator see https://gist.github.com/TorstenC/aec0724be4afcd1d7545
// tbl_modes[MODES_COUNT]: 777 bytes
// tbl_hours[HOUR_MODES_COUNT][HOUR_COUNT][MAX_HOUR_WORDS]: 1200 bytes
// tbl_minutes[MINUTE_MODES_COUNT][MINUTE_COUNT]: 4800 bytes
// illumination[1][WP_COUNT]: 237 bytes
// total (tbl_minutes + tbl_hours + tbl_modes + illumination): 7014 bytes
#define MODES_COUNT 17 // count of different display modes
@TorstenC
TorstenC / WC24h_16x16_Test.html
Last active August 29, 2015 14:10
Test der Tabellen der 24h Wordclock 16 x 16
This file has been truncated, but you can view the full file.
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>WordClock24 Tabellen-Test</title>
<style type="text/css">
td, th {font-weight:900;font-family:sans-serif;text-align:center;}
td {color:#222222;}
th {color:#FF1111;}
table {background-color:black;float:left;margin:5px;}
caption {border-width:5px 5px 0px;border-color:black;border-style:solid;}
:target {background-color: yellow;}
h1,h2 {clear:both;}
</style>
@TorstenC
TorstenC / WC24h_18x16_Test.html
Last active August 29, 2015 14:10
Test der Tabellen der 24h Wordclock 18 x 16
This file has been truncated, but you can view the full file.
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>WordClock24 Tabellen-Test</title>
<style type="text/css">
td, th {font-weight:900;font-family:sans-serif;text-align:center;}
td {color:#222222;}
th {color:#FF1111;}
table {background-color:black;float:left;margin:5px;}
caption {border-width:5px 5px 0px;border-color:black;border-style:solid;}
:target {background-color: yellow;}
h1,h2 {clear:both;}
</style>
@TorstenC
TorstenC / BTConnectionSPP.java
Created May 27, 2014 18:19
android Bluetooth Connection Serial Port Profile
public class BTConnectionSPP {
protected BluetoothAdapter BA;
protected BluetoothSocket socket;
protected OutputStream OS;
protected String DeviceName;
protected String ErrorMsg = "";
public boolean connect(String DeviceName) {
this.DeviceName = DeviceName;
BA = BluetoothAdapter.getDefaultAdapter();