Skip to content

Instantly share code, notes, and snippets.

View TorstenC's full-sized avatar

Torsten C. TorstenC

View GitHub Profile
@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();
@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 / 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 / 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 / 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 / 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 / WC24h_18x16.xml
Created December 7, 2014 22:58
Aus den Tabellen der 24h Wordclock 18 x 16 generiertes geprüftes XML
<?xml version="1.0" encoding="utf-8"?>
<WC24h version="WC24h16x16_28.Nov.2014_1607Uhr">
<!--ES#IST#SIND#HALB-->
<!--DREIVIERTELFACHT-->
<!--ZWEINEUNULLZWÖLF-->
<!--DREINSECHSIEB###-->
<!--##ELFÜNFZSIEBEND-->
<!--ZWANZIG#DREISSIG-->
<!--VIERZIG##FÜNFZIG-->
<!--MINUTENUHRVORUND-->
@TorstenC
TorstenC / display.h
Last active August 29, 2015 14:11
16 x 16 Arrays für das 24h Wordclock Mock-up aus den Tabellen
// Mock-up arrays for 24h Wordclock, see http://www.mikrocontroller.net/articles/WordClock24h
// Von-Neumann-Variant, Data from WC24h16x16_28.Nov.2014_1607Uhr_korr2, CodeGen v0.11
// Code-Generator see https://gist.github.com/TorstenC/aec0724be4afcd1d7545
#define DisplayX 16 // deprecated
#define WC_COLUMNS 16
#define DisplayY 16 // deprecated
#define WC_ROWS 16
struct WordIllu {
@TorstenC
TorstenC / tables.h
Last active August 29, 2015 14:11
16 x 16 Arrays aus den Tabellen der 24h Wordclock
// Word-Arrays for 24h Wordclock, see http://www.mikrocontroller.net/articles/WordClock24h
// Von-Neumann-Variant, Data from WC24h16x16_28.Nov.2014_1607Uhr_korr2 CodeGen v0.11
// Code-Generator see https://gist.github.com/TorstenC/aec0724be4afcd1d7545
// tbl_modes[MODES_COUNT]: 386 bytes
// tbl_hours[HOUR_MODES_COUNT][HOUR_COUNT][MAX_HOUR_WORDS]: 750 bytes
// tbl_minutes[MINUTE_MODES_COUNT][MINUTE_COUNT]: 3360 bytes
// illumination[1][WP_COUNT]: 252 bytes
// total (tbl_minutes + tbl_hours + tbl_modes + illumination): 4748 bytes
#define ModesCount 10 // deprecated
@TorstenC
TorstenC / HUB08_PAL_STM32.h
Last active August 29, 2015 14:11
WC24h-PCB-abstraction for HUB08 Display module and STM32F103C8T6
// Module Pin 26: "A" (PB14)
// Module Pin 27: 2.MOSI = G1 (PB15)
// Module Pin 28: 1.CK = SCK (PA8)
// Module Pin 29: 1.TX = B1 (PA9)
// Module Pin 30: "B" (PA10)
// Module Pin 31: "C" (PA11)
// Module Pin 32: "D" (PA12)
// Module Pin 38: 1.MOSI = R1 (PB5)
// Module Pin 39: LAT (PB6)
// Module Pin 40: OE (PB7)