commit 617bdc2d29f508336ebfc7d127922ca2f1f29cd8 Author: Eve Entropia Date: Tue Mar 30 18:55:18 2010 +0200 initial commit diff --git a/arduino/LCD4Bit b/arduino/LCD4Bit new file mode 120000 index 0000000..64c4a97 --- /dev/null +++ b/arduino/LCD4Bit @@ -0,0 +1 @@ +../arduino-0017/hardware/libraries/LCD4Bit \ No newline at end of file diff --git a/arduino/LCD4Bit.orig/LCD4Bit.cpp b/arduino/LCD4Bit.orig/LCD4Bit.cpp new file mode 100644 index 0000000..e285d60 --- /dev/null +++ b/arduino/LCD4Bit.orig/LCD4Bit.cpp @@ -0,0 +1,232 @@ +/* +LCD4Bit v0.1 16/Oct/2006 neillzero http://abstractplain.net + +What is this? +An arduino library for comms with HD44780-compatible LCD, in 4-bit mode (saves pins) + +Sources: +- The original "LiquidCrystal" 8-bit library and tutorial + http://www.arduino.cc/en/uploads/Tutorial/LiquidCrystal.zip + http://www.arduino.cc/en/Tutorial/LCDLibrary +- DEM 16216 datasheet http://www.maplin.co.uk/Media/PDFs/N27AZ.pdf +- Massimo's suggested 4-bit code (I took initialization from here) http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1144924220/8 +See also: +- glasspusher's code (probably more correct): http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1160586800/0#0 + +Tested only with a DEM 16216 (maplin "N27AZ" - http://www.maplin.co.uk/Search.aspx?criteria=N27AZ) +If you use this successfully, consider feeding back to the arduino wiki with a note of which LCD it worked on. + +Usage: +see the examples folder of this library distribution. + +*/ + +#include "LCD4Bit.h" +extern "C" { + #include //not needed yet + #include //needed for strlen() + #include + #include "WConstants.h" //all things wiring / arduino +} + +//command bytes for LCD +#define CMD_CLR 0x01 +#define CMD_RIGHT 0x1C +#define CMD_LEFT 0x18 +#define CMD_HOME 0x02 + +// --------- PINS ------------------------------------- +//is the RW pin of the LCD under our control? If we're only ever going to write to the LCD, we can use one less microcontroller pin, and just tie the LCD pin to the necessary signal, high or low. +//this stops us sending signals to the RW pin if it isn't being used. +int USING_RW = false; + +//RS, RW and Enable can be set to whatever you like +int RS = 12; +int RW = 11; +int Enable = 2; +//DB should be an unseparated group of pins - because of lazy coding in pushNibble() +int DB[] = {7, 8, 9, 10}; //wire these to DB4~7 on LCD. + +//-------------------------------------------------------- + +//how many lines has the LCD? (don't change here - specify on calling constructor) +int g_num_lines = 2; + +//pulse the Enable pin high (for a microsecond). +//This clocks whatever command or data is in DB4~7 into the LCD controller. +void LCD4Bit::pulseEnablePin(){ + digitalWrite(Enable,LOW); + delayMicroseconds(1); + // send a pulse to enable + digitalWrite(Enable,HIGH); + delayMicroseconds(1); + digitalWrite(Enable,LOW); + delay(1); // pause 1 ms. TODO: what delay, if any, is necessary here? +} + +//push a nibble of data through the the LCD's DB4~7 pins, clocking with the Enable pin. +//We don't care what RS and RW are, here. +void LCD4Bit::pushNibble(int value){ + int val_nibble= value & 0x0F; //clean the value. (unnecessary) + + for (int i=DB[0]; i <= DB[3]; i++) { + digitalWrite(i,val_nibble & 01); + val_nibble >>= 1; + } + pulseEnablePin(); +} + +//push a byte of data through the LCD's DB4~7 pins, in two steps, clocking each with the enable pin. +void LCD4Bit::pushByte(int value){ + int val_lower = value & 0x0F; + int val_upper = value >> 4; + pushNibble(val_upper); + pushNibble(val_lower); +} + + +//stuff the library user might call--------------------------------- +//constructor. num_lines must be 1 or 2, currently. +LCD4Bit::LCD4Bit (int num_lines) { + g_num_lines = num_lines; + if (g_num_lines < 1 || g_num_lines > 2) + { + g_num_lines = 1; + } +} + +void LCD4Bit::commandWriteNibble(int nibble) { + digitalWrite(RS, LOW); + if (USING_RW) { digitalWrite(RW, LOW); } + pushNibble(nibble); +} + + +void LCD4Bit::commandWrite(int value) { + digitalWrite(RS, LOW); + if (USING_RW) { digitalWrite(RW, LOW); } + pushByte(value); + //TODO: perhaps better to add a delay after EVERY command, here. many need a delay, apparently. +} + + + + +//print the given character at the current cursor position. overwrites, doesn't insert. +void LCD4Bit::print(int value) { + //set the RS and RW pins to show we're writing data + digitalWrite(RS, HIGH); + if (USING_RW) { digitalWrite(RW, LOW); } + + //let pushByte worry about the intricacies of Enable, nibble order. + pushByte(value); +} + + +//print the given string to the LCD at the current cursor position. overwrites, doesn't insert. +//While I don't understand why this was named printIn (PRINT IN?) in the original LiquidCrystal library, I've preserved it here to maintain the interchangeability of the two libraries. +void LCD4Bit::printIn(char msg[]) { + uint8_t i; //fancy int. avoids compiler warning when comparing i with strlen()'s uint8_t + for (i=0;i < strlen(msg);i++){ + print(msg[i]); + } +} + + +//send the clear screen command to the LCD +void LCD4Bit::clear(){ + commandWrite(CMD_CLR); + delay(1); +} + + +// initiatize lcd after a short pause +//while there are hard-coded details here of lines, cursor and blink settings, you can override these original settings after calling .init() +void LCD4Bit::init () { + pinMode(Enable,OUTPUT); + pinMode(RS,OUTPUT); + if (USING_RW) { pinMode(RW,OUTPUT); } + pinMode(DB[0],OUTPUT); + pinMode(DB[1],OUTPUT); + pinMode(DB[2],OUTPUT); + pinMode(DB[3],OUTPUT); + + delay(50); + + //The first 4 nibbles and timings are not in my DEM16217 SYH datasheet, but apparently are HD44780 standard... + commandWriteNibble(0x03); + delay(5); + commandWriteNibble(0x03); + delayMicroseconds(100); + commandWriteNibble(0x03); + delay(5); + + // needed by the LCDs controller + //this being 2 sets up 4-bit mode. + commandWriteNibble(0x02); + commandWriteNibble(0x02); + //todo: make configurable by the user of this library. + //NFXX where + //N = num lines (0=1 line or 1=2 lines). + //F= format (number of dots (0=5x7 or 1=5x10)). + //X=don't care + + int num_lines_ptn = g_num_lines - 1 << 3; + int dot_format_ptn = 0x00; //5x7 dots. 0x04 is 5x10 + + commandWriteNibble(num_lines_ptn | dot_format_ptn); + delayMicroseconds(60); + + //The rest of the init is not specific to 4-bit mode. + //NOTE: we're writing full bytes now, not nibbles. + + // display control: + // turn display on, cursor off, no blinking + commandWrite(0x0C); + delayMicroseconds(60); + + //clear display + commandWrite(0x01); + delay(3); + + // entry mode set: 06 + // increment automatically, display shift, entire shift off + commandWrite(0x06); + + delay(1);//TODO: remove unnecessary delays +} + + +//non-core stuff -------------------------------------- +//move the cursor to the given absolute position. line numbers start at 1. +//if this is not a 2-line LCD4Bit instance, will always position on first line. +void LCD4Bit::cursorTo(int line_num, int x){ + //first, put cursor home + commandWrite(CMD_HOME); + + //if we are on a 1-line display, set line_num to 1st line, regardless of given + if (g_num_lines==1){ + line_num = 1; + } + //offset 40 chars in if second line requested + if (line_num == 2){ + x += 40; + } + //advance the cursor to the right according to position. (second line starts at position 40). + for (int i=0; i + +class LCD4Bit { +public: + LCD4Bit(int num_lines); + void commandWrite(int value); + void init(); + void print(int value); + void printIn(char value[]); + void clear(); + //non-core--------------- + void cursorTo(int line_num, int x); + void leftScroll(int chars, int delay_time); + //end of non-core-------- + + //4bit only, therefore ideally private but may be needed by user + void commandWriteNibble(int nibble); +private: + void pulseEnablePin(); + void pushNibble(int nibble); + void pushByte(int value); +}; + +#endif diff --git a/arduino/LCD4Bit.orig/examples/LCD4BitExample/LCD4BitExample.pde b/arduino/LCD4Bit.orig/examples/LCD4BitExample/LCD4BitExample.pde new file mode 100644 index 0000000..e50c011 --- /dev/null +++ b/arduino/LCD4Bit.orig/examples/LCD4BitExample/LCD4BitExample.pde @@ -0,0 +1,47 @@ +//example use of LCD4Bit library + +#include +//create object to control an LCD. +//number of lines in display=1 +LCD4Bit lcd = LCD4Bit(1); + +//some messages to display on the LCD +char msgs[6][15] = {"apple", "banana", "pineapple", "mango", "watermelon", "pear"}; +int NUM_MSGS = 6; + +void setup() { + pinMode(13, OUTPUT); //we'll use the debug LED to output a heartbeat + + lcd.init(); + //optionally, now set up our application-specific display settings, overriding whatever the lcd did in lcd.init() + //lcd.commandWrite(0x0F);//cursor on, display on, blink on. (nasty!) +} + +void loop() { + digitalWrite(13, HIGH); //light the debug LED + + //pick a random message from the array + int pick = random(NUM_MSGS); + char* msg = msgs[pick]; + + lcd.clear(); + lcd.printIn(msg); + delay(1000); + digitalWrite(13, LOW); + + //print some dots individually + for (int i=0; i<3; i++){ + lcd.print('.'); + delay(100); + } + //print something on the display's second line. + //uncomment this if your display HAS two lines! + /* + lcd.cursorTo(2, 0); //line=2, x=0. + lcd.printIn("Score: 6/7"); + delay(1000); + */ + + //scroll entire display 20 chars to left, delaying 50ms each inc + lcd.leftScroll(20, 50); +} diff --git a/arduino/LCD4Bit.orig/keywords.txt b/arduino/LCD4Bit.orig/keywords.txt new file mode 100644 index 0000000..74b2d7c --- /dev/null +++ b/arduino/LCD4Bit.orig/keywords.txt @@ -0,0 +1,27 @@ +####################################### +# Syntax Coloring Map For Matrix +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +LCD4Bit KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +clear KEYWORD2 +commandWrite KEYWORD2 +cursorTo KEYWORD2 +init KEYWORD2 +leftScroll KEYWORD2 +print KEYWORD2 +printIn KEYWORD2 +commandWriteNibble KEYWORD2 + +####################################### +# Constants (LITERAL1) +####################################### + diff --git a/arduino/LCD4Bit.orig/readme.txt b/arduino/LCD4Bit.orig/readme.txt new file mode 100644 index 0000000..be63d33 --- /dev/null +++ b/arduino/LCD4Bit.orig/readme.txt @@ -0,0 +1,38 @@ +This is a C++ library for Arduino for controlling an HD74800-compatible LCD in 4-bit mode. +Tested on Arduino 0005 Alpha. + +Installation +-------------------------------------------------------------------------------- + +To install this library, just place this entire folder as a subfolder in your +Arduino/lib/targets/libraries folder. + +When installed, this library should look like: + +Arduino/lib/targets/libraries/LCD4Bit (this library's folder) +Arduino/lib/targets/libraries/LCD4Bit/LCD4Bit.cpp (the library implementation file) +Arduino/lib/targets/libraries/LCD4Bit/LCD4Bit.h (the library description file) +Arduino/lib/targets/libraries/LCD4Bit/keywords.txt (the syntax coloring file) +Arduino/lib/targets/libraries/LCD4Bit/examples (the examples in the "open" menu) +Arduino/lib/targets/libraries/LCD4Bit/readme.txt (this file) + +Building +-------------------------------------------------------------------------------- + +After this library is installed, you just have to start the Arduino application. +You may see a few warning messages as it's built. + +To use this library in a sketch, go to the Sketch | Import Library menu and +select LCD4Bit. This will add a corresponding line to the top of your sketch: +#include + +To stop using this library, delete that line from your sketch. + +Geeky information: +After a successful build of this library, a new file named "LCD4Bit.o" will appear +in "Arduino/lib/targets/libraries/LCD4Bit". This file is the built/compiled library +code. + +If you choose to modify the code for this library (i.e. "LCD4Bit.cpp" or "LCD4Bit.h"), +then you must first 'unbuild' this library by deleting the "LCD4Bit.o" file. The +new "LCD4Bit.o" with your code will appear after the next press of "verify" diff --git a/arduino/arduinination/arduinination.pde b/arduino/arduinination/arduinination.pde new file mode 100644 index 0000000..9b82454 --- /dev/null +++ b/arduino/arduinination/arduinination.pde @@ -0,0 +1,38 @@ +#include +LCD4Bit lcd = LCD4Bit(2); + +void setup() { + lcd.init(); + lcd.clear(); + lcd.printIn("World Arduinination in progress..."); +} + +int i = 0,j = 0, dir = 1; +char bfr[4]; + +void loop() { + digitalWrite(13, HIGH); + + lcd.cursorTo(2, 0); + itoa(i, bfr, 10); + lcd.printIn(bfr); + lcd.printIn("%"); + + lcd.cursorTo(2, 4); + + for(j=0; j < (i / 3); j++) + lcd.print(255); + for(j=i/3; j < 100/3; j++) + lcd.printIn(" "); + + + if(i >= 98) + dir = -1; + if(dir == -1 && i <= 80) + dir = 1; + + i += dir; + + digitalWrite(13,LOW); + delay(100); +} diff --git a/arduino/i2c_fnord/applet/HardwareSerial.cpp.o b/arduino/i2c_fnord/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..690d98e Binary files /dev/null and b/arduino/i2c_fnord/applet/HardwareSerial.cpp.o differ diff --git a/arduino/i2c_fnord/applet/Print.cpp.o b/arduino/i2c_fnord/applet/Print.cpp.o new file mode 100644 index 0000000..624fc06 Binary files /dev/null and b/arduino/i2c_fnord/applet/Print.cpp.o differ diff --git a/arduino/i2c_fnord/applet/WInterrupts.c.o b/arduino/i2c_fnord/applet/WInterrupts.c.o new file mode 100644 index 0000000..10fbd46 Binary files /dev/null and b/arduino/i2c_fnord/applet/WInterrupts.c.o differ diff --git a/arduino/i2c_fnord/applet/WMath.cpp.o b/arduino/i2c_fnord/applet/WMath.cpp.o new file mode 100644 index 0000000..c2fe7dd Binary files /dev/null and b/arduino/i2c_fnord/applet/WMath.cpp.o differ diff --git a/arduino/i2c_fnord/applet/Wire/Wire.cpp.o b/arduino/i2c_fnord/applet/Wire/Wire.cpp.o new file mode 100644 index 0000000..bd0fc76 Binary files /dev/null and b/arduino/i2c_fnord/applet/Wire/Wire.cpp.o differ diff --git a/arduino/i2c_fnord/applet/Wire/utility/twi.c.o b/arduino/i2c_fnord/applet/Wire/utility/twi.c.o new file mode 100644 index 0000000..585ccf1 Binary files /dev/null and b/arduino/i2c_fnord/applet/Wire/utility/twi.c.o differ diff --git a/arduino/i2c_fnord/applet/core.a b/arduino/i2c_fnord/applet/core.a new file mode 100644 index 0000000..e6975dd Binary files /dev/null and b/arduino/i2c_fnord/applet/core.a differ diff --git a/arduino/i2c_fnord/applet/i2c_fnord.cpp b/arduino/i2c_fnord/applet/i2c_fnord.cpp new file mode 100644 index 0000000..f9830d9 --- /dev/null +++ b/arduino/i2c_fnord/applet/i2c_fnord.cpp @@ -0,0 +1,54 @@ +// Wire Master Writer +// by Nicholas Zambetti + +// Demonstrates use of the Wire library +// Writes data to an I2C/TWI slave device +// Refer to the "Wire Slave Receiver" example for use with this + +// Created 29 March 2006 + +#include + +#include "WProgram.h" +void setup(); +void loop(); +void setup() +{ + Wire.begin(); // join i2c bus (address optional for master) + Serial.begin(9600); +} + +byte x = 0; + +void loop() +{ + + Wire.beginTransmission(4); // transmit to device #4 + Wire.send("x is "); // sends five bytes + Wire.send(x); // sends one byte + Wire.endTransmission(); // stop transmitting + + //Wire.requestFrom(2,2); + while(Wire.available()) // loop through all but the last + { + char c = Wire.receive(); // receive byte as a character + Serial.print(c); // print the character + } + + x++; + delay(500); + Serial.print("."); +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/arduino/i2c_fnord/applet/i2c_fnord.cpp.eep b/arduino/i2c_fnord/applet/i2c_fnord.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/arduino/i2c_fnord/applet/i2c_fnord.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/arduino/i2c_fnord/applet/i2c_fnord.cpp.elf b/arduino/i2c_fnord/applet/i2c_fnord.cpp.elf new file mode 100755 index 0000000..a54e12e Binary files /dev/null and b/arduino/i2c_fnord/applet/i2c_fnord.cpp.elf differ diff --git a/arduino/i2c_fnord/applet/i2c_fnord.cpp.hex b/arduino/i2c_fnord/applet/i2c_fnord.cpp.hex new file mode 100644 index 0000000..bac0b77 --- /dev/null +++ b/arduino/i2c_fnord/applet/i2c_fnord.cpp.hex @@ -0,0 +1,245 @@ +:100000000C9436000C945E000C945E000C945E0020 +:100010000C945E000C945E000C945E000C945E00E8 +:100020000C945E000C945E000C945E000C945E00D8 +:100030000C945E000C945E000C945E000C945E00C8 +:100040000C948D040C945E000C9439050C945E00A5 +:100050000C945E000C945E000C945E000C945E00A8 +:100060000C948E020C945E00A501820611241FBE22 +:10007000CFEFD4E0DEBFCDBF11E0A0E0B1E0ECE116 +:10008000FFE002C005900D92A831B107D9F711E049 +:10009000A8E1B1E001C01D92AA3DB107E1F710E06F +:1000A000CCE6D0E004C02297FE010E948807C83643 +:1000B000D107C9F70E9486040C948C070C940000A9 +:1000C0000F931F93CF93DF93689F8001699F100D5B +:1000D000789F100D1124C8010E947C00EC0100974C +:1000E00029F060E070E0A8010E947B01CE01DF9161 +:1000F000CF911F910F910895CF93DF93BC01823070 +:10010000910510F462E070E0A091D801B091D9019E +:10011000ED01E0E0F0E040E050E021C0888199810D +:100120008617970769F48A819B81309719F093832A +:10013000828304C09093D9018093D801FE0133C01B +:100140006817790738F44115510519F08417950798 +:1001500008F4AC01FE018A819B819C01E901209792 +:10016000E9F641155105A1F1CA01861B970B0497C9 +:1001700008F4BA01E0E0F0E029C08D919C9111975C +:1001800084179507F1F46417750779F4ED018A81F6 +:100190009B81309719F09383828304C09093D90197 +:1001A0008093D801FD0132964CC0CA01861B970B83 +:1001B000FD01E80FF91F6193719302978D939C9352 +:1001C00040C0FD01828193819C01D9011097A9F65D +:1001D0008091D6019091D701892B41F480910A0139 +:1001E00090910B019093D7018093D60140910C011F +:1001F00050910D014115510541F44DB75EB7809105 +:10020000080190910901481B590B2091D6013091AA +:10021000D701CA01821B930B8617970780F0AB01A9 +:100220004E5F5F4F8417950750F0420F531F509356 +:10023000D7014093D601F9016193719302C0E0E0C8 +:10024000F0E0CF01DF91CF910895CF93DF93009736 +:1002500009F44EC0EC0122971B821A82A091D801AA +:10026000B091D901109701F140E050E0AC17BD0703 +:1002700000F1BB83AA83FE0121913191E20FF31FAC +:10028000AE17BF0771F48D919C911197280F391FFC +:100290002E5F3F4F39832883FD01828193819B83A9 +:1002A0008A834115510569F4D093D901C093D801CF +:1002B0001FC0FD0182819381AD01009711F0DC0127 +:1002C000D5CFFA01D383C28321913191E20FF31F7D +:1002D000CE17DF0769F488819981280F391F2E5FB7 +:1002E0003F4FFA01318320838A819B8193838283EC +:1002F000DF91CF910895DC0101C06D9341505040D2 +:10030000E0F7089581E08093210160931C01109231 +:100310001F0110922001089580911B0190911A01F4 +:10032000891B089590911A0180911B01981710F074 +:1003300080E00895E0911801F0911901E90FF11D95 +:1003400080819F5F90931A0108950895DF93CF9362 +:100350000F92CDB7DEB76983809121018823A9F080 +:10036000809120018032B0F480911F01E0911D0145 +:10037000F0911E01E80FF11D608380911F018F5FD6 +:1003800080931F018093200105C0CE01019661E09A +:100390000E9471020F90CF91DF910895EF92FF922A +:1003A0000F931F93CF93DF937C01042F8091210142 +:1003B000882359F0EB0110E005C0C70169910E9444 +:1003C000A6011F5F1017C8F304C0CB01642F0E9461 +:1003D0007102DF91CF911F910F91FF90EF900895DF +:1003E000DB010D900020E9F71197A61BB70B4A2FF0 +:1003F0000E94CE01089560911D0170911E018091AF +:100400001C014091200121E00E942C0210921F014A +:100410001092200110922101089580E290E061E0A5 +:1004200070E00E946000809318019093190110926F +:100430001A0110921B0180E290E061E070E00E94DE +:10044000600080931D0190931E0110921F01109275 +:1004500020010E94100408951F93582F122F41323B +:1004600010F081E03CC0809123018823E1F782E015 +:10047000809323018FEF8093340110922B014093DE +:100480002C01A0912901B0912A01FB0102C08191A8 +:100490008D938E2F861B8417D0F3852F90E0880FC5 +:1004A000991F8093240185EE8093BC00112321F0D5 +:1004B000809123018230E1F3809134018F3F11F468 +:1004C00080E00DC080913401803211F482E007C0D9 +:1004D00080913401803311F084E001C083E01F91EA +:1004E0000895482F613210F081E008958091230132 +:1004F000843011F082E0089560933001A0912D01C5 +:10050000B0912E01842F9C01F90102C081918D933D +:100510008E2F841B8617D0F380E008951F920F92D0 +:100520000FB60F9211242F933F934F935F936F93C6 +:100530007F938F939F93AF93BF93EF93FF9380919C +:10054000B90090E0887F90708036910509F4E2C090 +:1005500081369105CCF58832910509F47BC089324A +:100560009105B4F48031910509F46FC08131910592 +:100570003CF4009709F438C1089709F040C165C000 +:100580008831910509F466C0809709F038C17FC0B1 +:100590008034910509F4A3C08134910544F480337B +:1005A000910509F47FC0C89709F029C186C080353C +:1005B000910509F486C08835910509F495C0883401 +:1005C000910509F01CC19EC08839910509F404C148 +:1005D00089399105ECF48837910509F49BC0893776 +:1005E00091054CF48836910509F494C08037910543 +:1005F00009F005C18FC08838910509F4EDC0803934 +:10060000910509F48DC08038910509F0F8C088C0C3 +:10061000803B910509F4B2C0813B91054CF4803ACE +:10062000910509F491C0883A910509F0E8C0A6C087 +:10063000803C910509F4D4C0883C910509F4D0C0F0 +:10064000883B910509F0DBC0B1C080912401809303 +:10065000BB00C0C090912B0180912C01981778F4B9 +:1006600090912B01E0912901F0912A01E90FF11DF0 +:1006700080818093BB009F5F90932B01ABC085ED81 +:100680008093BC008091BC0084FDFCCFB6C080E2AA +:100690008093340185ED8093BC008091BC0084FD83 +:1006A000FCCFABC080E38093340185ED8093BC0028 +:1006B0008091BC0084FDFCCFA0C088E3809334010E +:1006C0008FC080912B019091BB00E0912901F091A6 +:1006D0002A01E80FF11D90838F5F80932B01909189 +:1006E0002B0180912C0174C080912B019091BB0053 +:1006F000E0912901F0912A01E80FF11D90838F5FAD +:1007000080932B0185ED8093BC008091BC0084FD1B +:10071000FCCF73C083E080932301109233015AC051 +:1007200080913301803208F057C08091330190915D +:10073000BB00E0913101F0913201E80FF11D90838F +:100740008F5F8093330146C080913301803248F43B +:1007500080913301E0913101F0913201E80FF11DF8 +:10076000108260913301E0912701F091280180917E +:1007700031019091320170E0099532C084E080939C +:10078000230110922F0110923001E0912501F09188 +:100790002601099580913001882341F481E08093FE +:1007A0003001E0912D01F0912E01108290912F01E6 +:1007B000E0912D01F0912E01E90FF11D80818093D0 +:1007C000BB009F5F90932F0190912F01809130018A +:1007D000981710F485EC01C085E88093BC000FC029 +:1007E00085EC8093BC0009C01092340185ED8093A4 +:1007F000BC008091BC0084FDFCCF10922301FF91CE +:10080000EF91BF91AF919F918F917F916F915F9188 +:100810004F913F912F910F900FBE0F901F90189501 +:1008200010922301449A459AE9EBF0E080818E7F93 +:10083000808380818D7F808388E48093B80085E405 +:100840008093BC0080E290E061E070E00E94600074 +:100850008093290190932A0180E290E061E070E0AA +:100860000E94600080932D0190932E0180E290E021 +:1008700061E070E00E94600080933101909332014A +:10088000089582E291E064E070E00E94820182E2D9 +:1008900091E060E071E00E94F00182E291E06091FD +:1008A00035010E94A60182E291E00E94FB0109C08D +:1008B00082E291E00E949201682F83EC91E00E9415 +:1008C000F30682E291E00E948C01882389F78091EF +:1008D00035018F5F8093350164EF71E080E090E037 +:1008E0000E94D50483EC91E066E071E00E94FB0673 +:1008F000089582E291E00E940D0283EC91E040E8CD +:1009000055E260E070E00E94760508950E94FF04C1 +:100910000E9479040E944104FDCF1F920F920FB6EE +:100920000F9211242F933F938F939F93AF93BF9375 +:1009300080913A0190913B01A0913C01B0913D0121 +:1009400030913E010196A11DB11D232F2D5F2D3742 +:1009500020F02D570196A11DB11D20933E018093DB +:100960003A0190933B01A0933C01B0933D018091EB +:10097000360190913701A0913801B091390101966B +:10098000A11DB11D8093360190933701A0933801CA +:10099000B0933901BF91AF919F918F913F912F916A +:1009A0000F900FBE0F901F901895EF92FF920F932C +:1009B0001F937B018C018FB7F89440913A015091BD +:1009C0003B0160913C0170913D018FBF2FB7F894BE +:1009D00080913A0190913B01A0913C01B0913D0181 +:1009E0002FBF841B950BA60BB70BE816F9060A0759 +:1009F0001B0760F71F910F91FF90EF900895789477 +:100A000084B5826084BD84B5816084BD85B5826013 +:100A100085BD85B5816085BDEEE6F0E080818160B1 +:100A20008083E1E8F0E08081826080838081816062 +:100A30008083E0E8F0E0808181608083E1EBF0E09A +:100A4000808184608083E0EBF0E08081816080833E +:100A5000EAE7F0E080818460808380818260808327 +:100A60008081816080838081806880831092C10052 +:100A700008951F920F920FB60F9211242F933F9358 +:100A80004F935F936F937F938F939F93AF93BF9396 +:100A9000EF93FF934091C600E091BF01F091C00138 +:100AA000CF01019660E870E00E9422079C018091CE +:100AB000C1019091C2012817390739F0E15CFE4F5E +:100AC00040833093C0012093BF01FF91EF91BF910C +:100AD000AF919F918F917F916F915F914F913F91D6 +:100AE0002F910F900FBE0F901F9018955F926F92ED +:100AF0007F928F929F92AF92BF92CF92DF92EF92AE +:100B0000FF920F931F93CF93DF93EC013A014B01B8 +:100B1000413482E458078FE0680780E078070CF0E2 +:100B20007FC060E874E88EE190E0A40193010E9428 +:100B300057072150304040405040CA01B90122E0DF +:100B400030E040E050E00E94570759016A01A601D9 +:100B50009501209530954095509594E0220F331FD4 +:100B6000441F551F9A95D1F760E074E284EF90E03E +:100B70000E945707CA01B9012FEF30E040E050E072 +:100B80000E940307A40193010E945707C9018150E5 +:100B90009F4F181619061CF4522E5A9403C0552460 +:100BA0005394521A60E079E08DE390E0A401930140 +:100BB0000E9457072150304040405040CA01B901BF +:100BC00022E030E040E050E00E9457072095309549 +:100BD0004095509583E0220F331F441F551F8A957F +:100BE000D1F760E074E284EF90E00E945707CA01F9 +:100BF000B9012FEF30E040E050E00E940307A4016C +:100C000093010E945707C90181509F4F181619067A +:100C10001CF4822F815002C081E0821B851500F5F3 +:100C2000E885F98581E090E00A8802C0880F991F65 +:100C30000A94E2F7808360E079E08DE390E0A4011C +:100C400093010E9457072150304040405040CA0154 +:100C5000B90122E030E040E050E00E94570704C0B4 +:100C6000E885F98510829501EC81FD813083EE8164 +:100C7000FF812083EA85FB85208141E050E0CA01A5 +:100C80000E8402C0880F991F0A94E2F7282B208354 +:100C9000EA85FB852081CA010F8402C0880F991F55 +:100CA0000A94E2F7282B2083EA85FB858081088857 +:100CB00002C0440F551F0A94E2F7842B8083DF9112 +:100CC000CF911F910F91FF90EF90DF90CF90BF9049 +:100CD000AF909F908F907F906F905F900895FC01F0 +:100CE000A085B18521898C9190E0022E02C0959556 +:100CF00087950A94E2F780FFF6CF0484F585E02D0E +:100D00006083089582E191E09093C4018093C301D0 +:100D10008FE391E09093C6018093C50185EC90E04C +:100D20009093C8018093C70184EC90E09093CA012E +:100D30008093C90180EC90E09093CC018093CB012B +:100D400081EC90E09093CE018093CD0186EC90E011 +:100D50009093D0018093CF0184E08093D10183E010 +:100D60008093D20187E08093D30185E08093D40102 +:100D700081E08093D50108950F931F93CF93DF9364 +:100D80008C01EB0109C02196D801ED91FC910190F5 +:100D9000F081E02DC801099568816623A1F7DF91F4 +:100DA000CF911F910F910895EF92FF920F931F9390 +:100DB000CF93DF938C017B01EA010CC0D7016D91C9 +:100DC0007D01D801ED91FC910190F081E02DC801E9 +:100DD00009952197209791F7DF91CF911F910F915E +:100DE000FF90EF900895DC01ED91FC910190F0816E +:100DF000E02D09950895DC01ED91FC910280F381CD +:100E0000E02D09950895629FD001739FF001829FA4 +:100E1000E00DF11D649FE00DF11D929FF00D839F89 +:100E2000F00D749FF00D659FF00D9927729FB00D26 +:100E3000E11DF91F639FB00DE11DF91FBD01CF0139 +:100E40001124089597FB092E07260AD077FD04D0B8 +:100E500049D006D000201AF4709561957F4F08950F +:100E6000F6F7909581959F4F0895A1E21A2EAA1B3F +:100E7000BB1BFD010DC0AA1FBB1FEE1FFF1FA2174A +:100E8000B307E407F50720F0A21BB30BE40BF50B47 +:100E9000661F771F881F991F1A9469F760957095D0 +:100EA000809590959B01AC01BD01CF01089597FB02 +:100EB000092E05260ED057FD04D0D7DF0AD0001C1E +:100EC00038F450954095309521953F4F4F4F5F4FE7 +:100ED0000895F6F790958095709561957F4F8F4FA7 +:100EE0009F4F0895AA1BBB1B51E107C0AA1FBB1F40 +:100EF000A617B70710F0A61BB70B881F991F5A95A6 +:100F0000A9F780959095BC01CD010895EE0FFF1FC4 +:0C0F10000590F491E02D0994F894FFCFB7 +:100F1C007820697320002E002000DA010000000008 +:080F2C0000006F06BC06D406AC +:00000001FF diff --git a/arduino/i2c_fnord/applet/i2c_fnord.cpp.o b/arduino/i2c_fnord/applet/i2c_fnord.cpp.o new file mode 100644 index 0000000..4f506ac Binary files /dev/null and b/arduino/i2c_fnord/applet/i2c_fnord.cpp.o differ diff --git a/arduino/i2c_fnord/applet/pins_arduino.c.o b/arduino/i2c_fnord/applet/pins_arduino.c.o new file mode 100644 index 0000000..f851e85 Binary files /dev/null and b/arduino/i2c_fnord/applet/pins_arduino.c.o differ diff --git a/arduino/i2c_fnord/applet/wiring.c.o b/arduino/i2c_fnord/applet/wiring.c.o new file mode 100644 index 0000000..450a0e1 Binary files /dev/null and b/arduino/i2c_fnord/applet/wiring.c.o differ diff --git a/arduino/i2c_fnord/applet/wiring_analog.c.o b/arduino/i2c_fnord/applet/wiring_analog.c.o new file mode 100644 index 0000000..fbc3d62 Binary files /dev/null and b/arduino/i2c_fnord/applet/wiring_analog.c.o differ diff --git a/arduino/i2c_fnord/applet/wiring_digital.c.o b/arduino/i2c_fnord/applet/wiring_digital.c.o new file mode 100644 index 0000000..1f02e56 Binary files /dev/null and b/arduino/i2c_fnord/applet/wiring_digital.c.o differ diff --git a/arduino/i2c_fnord/applet/wiring_pulse.c.o b/arduino/i2c_fnord/applet/wiring_pulse.c.o new file mode 100644 index 0000000..58b5465 Binary files /dev/null and b/arduino/i2c_fnord/applet/wiring_pulse.c.o differ diff --git a/arduino/i2c_fnord/applet/wiring_shift.c.o b/arduino/i2c_fnord/applet/wiring_shift.c.o new file mode 100644 index 0000000..9c3045a Binary files /dev/null and b/arduino/i2c_fnord/applet/wiring_shift.c.o differ diff --git a/arduino/i2c_fnord/i2c_fnord.pde b/arduino/i2c_fnord/i2c_fnord.pde new file mode 100644 index 0000000..56111b6 --- /dev/null +++ b/arduino/i2c_fnord/i2c_fnord.pde @@ -0,0 +1,38 @@ +// Wire Master Writer +// by Nicholas Zambetti + +// Demonstrates use of the Wire library +// Writes data to an I2C/TWI slave device +// Refer to the "Wire Slave Receiver" example for use with this + +// Created 29 March 2006 + +#include + +void setup() +{ + Wire.begin(); // join i2c bus (address optional for master) + Serial.begin(9600); +} + +byte x = 0; + +void loop() +{ + + Wire.beginTransmission(4); // transmit to device #4 + Wire.send("x is "); // sends five bytes + Wire.send(x); // sends one byte + Wire.endTransmission(); // stop transmitting + + //Wire.requestFrom(2,2); + while(Wire.available()) // loop through all but the last + { + char c = Wire.receive(); // receive byte as a character + Serial.print(c); // print the character + } + + x++; + delay(500); + Serial.print("."); +} diff --git a/arduino/sketch_nov03a/applet/HardwareSerial.cpp.o b/arduino/sketch_nov03a/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..690d98e Binary files /dev/null and b/arduino/sketch_nov03a/applet/HardwareSerial.cpp.o differ diff --git a/arduino/sketch_nov03a/applet/Print.cpp.o b/arduino/sketch_nov03a/applet/Print.cpp.o new file mode 100644 index 0000000..624fc06 Binary files /dev/null and b/arduino/sketch_nov03a/applet/Print.cpp.o differ diff --git a/arduino/sketch_nov03a/applet/WInterrupts.c.o b/arduino/sketch_nov03a/applet/WInterrupts.c.o new file mode 100644 index 0000000..10fbd46 Binary files /dev/null and b/arduino/sketch_nov03a/applet/WInterrupts.c.o differ diff --git a/arduino/sketch_nov03a/applet/WMath.cpp.o b/arduino/sketch_nov03a/applet/WMath.cpp.o new file mode 100644 index 0000000..c2fe7dd Binary files /dev/null and b/arduino/sketch_nov03a/applet/WMath.cpp.o differ diff --git a/arduino/sketch_nov03a/applet/core.a b/arduino/sketch_nov03a/applet/core.a new file mode 100644 index 0000000..cb13353 Binary files /dev/null and b/arduino/sketch_nov03a/applet/core.a differ diff --git a/arduino/sketch_nov03a/applet/pins_arduino.c.o b/arduino/sketch_nov03a/applet/pins_arduino.c.o new file mode 100644 index 0000000..f851e85 Binary files /dev/null and b/arduino/sketch_nov03a/applet/pins_arduino.c.o differ diff --git a/arduino/sketch_nov03a/applet/sketch_nov03a.cpp b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp new file mode 100644 index 0000000..6294401 --- /dev/null +++ b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp @@ -0,0 +1,81 @@ +#include +#include + + +#include "WProgram.h" +void setup(); +void loop(); +int pinA = 11; +int pinB = 12; +int ledPin = 13; + +void setup() { + //Timer2 Settings + TCCR2A = 0; + TCCR2B = 0<>1); + } + + val_alt = val; + + delay(100); + digitalWrite(13,LOW); + delay(100); +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.eep b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.elf b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.elf new file mode 100755 index 0000000..8f668cc Binary files /dev/null and b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.elf differ diff --git a/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.hex b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.hex new file mode 100644 index 0000000..9e1f231 --- /dev/null +++ b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.hex @@ -0,0 +1,180 @@ +:100000000C9462000C948A000C948A000C948A0070 +:100010000C948A000C948A000C948A000C948A0038 +:100020000C948A000C94B7000C948A000C948A00FB +:100030000C948A000C948A000C948A000C948A0018 +:100040000C94B8010C948A000C9464020C948A00FD +:100050000C948A000C948A000C948A000C948A00F8 +:100060000C948A000C948A000000000024002700F1 +:100070002A0000000000250028002B0000000000DE +:1000800023002600290004040404040404040202DA +:100090000202020203030303030301020408102007 +:1000A0004080010204081020010204081020000012 +:1000B0000007000201000003040600000000000029 +:1000C0000000AD0311241FBECFEFD4E0DEBFCDBFD3 +:1000D00011E0A0E0B1E0EEE1FBE002C005900D927E +:1000E000AE30B107D9F711E0AEE0B1E001C01D922A +:1000F000A13BB107E1F710E0C4ECD0E004C02297C7 +:10010000FE010E948905C23CD107C9F70E94150172 +:100110000C948D050C9400001F938DE061E00E940B +:100120001C01F89410910E01789480910F0118171A +:1001300051F0612F772767FD7095759567958EE96A +:1001400091E00E94F40410930F0164E670E080E0F7 +:1001500090E00E9400028DE060E00E941C0164E6D5 +:1001600070E080E090E00E9400021F9108951F92CD +:100170000F920FB60F9211241F932F933F934F931B +:100180005F936F937F938F939F93AF93BF93EF93FF +:10019000FF93809100010E946901892B11F013E007 +:1001A00001C010E0809102010E946901892B11F0C9 +:1001B00081E0182790911001911B90FF09C01093C6 +:1001C000100180910E0181509270890F80930E0171 +:1001D000FF91EF91BF91AF919F918F917F916F911F +:1001E0005F914F913F912F911F910F900FBE0F90F4 +:1001F0001F9018951092B00082E08093B10081E0CA +:10020000809370008091000161E00E941C01809148 +:10021000020161E00E941C018EE991E040E855E294 +:1002200060E070E00E94A10208950E942A020E94EC +:10023000FA000E948C00FDCF482F50E0CA01825581 +:100240009F4FFC012491CA0186569F4FFC01949157 +:100250004A575F4FFA0134913323D1F1222331F110 +:10026000233021F4809180008F7705C0243031F451 +:10027000809180008F7D8093800018C0213019F418 +:1002800084B58F7704C0223021F484B58F7D84BD7E +:100290000DC0263021F48091B0008F7705C0273043 +:1002A00029F48091B0008F7D8093B000E32FF0E0BF +:1002B000EE0FFF1FEE58FF4FA591B491662329F46E +:1002C0008C91909589238C9308958C91892B8C9394 +:1002D0000895682F70E0CB0182559F4FFC01249157 +:1002E000CB0186569F4FFC0144916A577F4FFB011B +:1002F0009491992319F420E030E038C0222331F1A1 +:10030000233021F4809180008F7705C0243031F4B0 +:10031000809180008F7D8093800018C0213019F477 +:1003200084B58F7704C0223021F484B58F7D84BDDD +:100330000DC0263021F48091B0008F7705C02730A2 +:1003400029F48091B0008F7D8093B000892F90E0D8 +:10035000880F991F84589F4FFC01A591B4918C91EF +:1003600020E030E0842311F021E030E0C90108955D +:100370001F920F920FB60F9211242F933F938F93DA +:100380009F93AF93BF938091150190911601A09117 +:100390001701B0911801309119010196A11DB11DED +:1003A000232F2D5F2D3720F02D570196A11DB11D54 +:1003B000209319018093150190931601A0931701C2 +:1003C000B09318018091110190911201A091130135 +:1003D000B09114010196A11DB11D8093110190935C +:1003E0001201A0931301B0931401BF91AF919F919B +:1003F0008F913F912F910F900FBE0F901F901895E6 +:10040000EF92FF920F931F937B018C018FB7F894AB +:1004100040911501509116016091170170911801DA +:100420008FBF2FB7F8948091150190911601A0917C +:100430001701B09118012FBF841B950BA60BB70BAA +:10044000E816F9060A071B0760F71F910F91FF9046 +:10045000EF900895789484B5826084BD84B58160FE +:1004600084BD85B5826085BD85B5816085BDEEE6BC +:10047000F0E0808181608083E1E8F0E0808182604B +:100480008083808181608083E0E8F0E0808181600A +:100490008083E1EBF0E0808184608083E0EBF0E03A +:1004A000808181608083EAE7F0E0808184608083DE +:1004B0008081826080838081816080838081806888 +:1004C00080831092C10008951F920F920FB60F9271 +:1004D00011242F933F934F935F936F937F938F9349 +:1004E0009F93AF93BF93EF93FF934091C600E0912A +:1004F0009A01F0919B01CF01019660E870E00E94A3 +:1005000023059C0180919C0190919D01281739073A +:1005100039F0E65EFE4F408330939B0120939A01B1 +:10052000FF91EF91BF91AF919F918F917F916F91CB +:100530005F914F913F912F910F900FBE0F901F90A1 +:1005400018955F926F927F928F929F92AF92BF9217 +:10055000CF92DF92EF92FF920F931F93CF93DF938F +:10056000EC013A014B01413482E458078FE06807FF +:1005700080E078070CF07FC060E874E88EE190E0DE +:10058000A40193010E945805215030404040504042 +:10059000CA01B90122E030E040E050E00E94580575 +:1005A00059016A01A6019501209530954095509515 +:1005B00094E0220F331F441F551F9A95D1F760E036 +:1005C00074E284EF90E00E945805CA01B9012FEF50 +:1005D00030E040E050E00E940405A40193010E9435 +:1005E0005805C90181509F4F181619061CF4522E48 +:1005F0005A9403C055245394521A60E079E08DE375 +:1006000090E0A40193010E945805215030404040E1 +:100610005040CA01B90122E030E040E050E00E94C1 +:100620005805209530954095509583E0220F331F53 +:10063000441F551F8A95D1F760E074E284EF90E083 +:100640000E945805CA01B9012FEF30E040E050E0A8 +:100650000E940405A40193010E945805C90181501C +:100660009F4F181619061CF4822F815002C081E09A +:10067000821B851500F5E885F98581E090E00A8800 +:1006800002C0880F991F0A94E2F7808360E079E046 +:100690008DE390E0A40193010E9458052150304061 +:1006A00040405040CA01B90122E030E040E050E053 +:1006B0000E94580504C0E885F98510829501EC81F7 +:1006C000FD813083EE81FF812083EA85FB852081D7 +:1006D00041E050E0CA010E8402C0880F991F0A94BD +:1006E000E2F7282B2083EA85FB852081CA010F844D +:1006F00002C0880F991F0A94E2F7282B2083EA850D +:10070000FB858081088802C0440F551F0A94E2F7D8 +:10071000842B8083DF91CF911F910F91FF90EF90F9 +:10072000DF90CF90BF90AF909F908F907F906F9011 +:100730005F900895FC01A085B18521898C9190E09E +:10074000022E02C0959587950A94E2F780FFF6CFB6 +:100750000484F585E02D6083089588E091E090930E +:100760009F0180939E018AE191E09093A101809383 +:10077000A00185EC90E09093A3018093A20184EC0A +:1007800090E09093A5018093A40180EC90E0909379 +:10079000A7018093A60181EC90E09093A90180933A +:1007A000A80186EC90E09093AB018093AA0184E0CD +:1007B0008093AC0183E08093AD0187E08093AE012C +:1007C00085E08093AF0181E08093B00108950F939D +:1007D0001F93CF93DF938C01EB0109C02196D801C1 +:1007E000ED91FC910190F081E02DC801099568819F +:1007F0006623A1F7DF91CF911F910F910895EF929A +:10080000FF920F931F93CF93DF938C017B01EA013B +:100810000CC0D7016D917D01D801ED91FC91019043 +:10082000F081E02DC80109952197209791F7DF917C +:10083000CF911F910F91FF90EF9008950F931F9309 +:100840008C01DC01ED91FC910190F081E02D6DE0D7 +:100850000995D801ED91FC910190F081E02DC8013E +:100860006AE009951F910F9108952F923F924F9240 +:100870005F926F927F928F929F92AF92BF92CF9230 +:10088000DF92EF92FF920F931F93DF93CF93CDB739 +:10089000DEB7A0970FB6F894DEBF0FBECDBF1C0128 +:1008A0006A017B01411551056105710549F4DC01BF +:1008B000ED91FC910190F081E02D60E3099554C029 +:1008C000882499245401422E55246624772401E07B +:1008D00010E00C0F1D1F080D191DC701B601A30163 +:1008E00092010E943605F80160830894811C911CD6 +:1008F000A11CB11CC701B601A30192010E943605DB +:10090000C901DA016C017D01C114D104E104F104D3 +:10091000F1F681E0E82EF12CEC0EFD1EE80CF91C3E +:100920003E010894611C711CD501C4010197A10905 +:10093000B1096C01C818D90814C0F601EE0DFF1DED +:1009400060816A3010F4605D01C0695CD101ED9195 +:10095000FC910190F081E02DC10109950894E10816 +:10096000F1086E147F0449F7A0960FB6F894DEBF25 +:100970000FBECDBFCF91DF911F910F91FF90EF90F0 +:10098000DF90CF90BF90AF909F908F907F906F90AF +:100990005F904F903F902F900895EF92FF920F93AA +:1009A0001F93CF93DF93EC017A018B0177FF0FC088 +:1009B000E881F9810190F081E02D6DE209951095B3 +:1009C0000095F094E094E11CF11C011D111DCE0175 +:1009D000B801A7012AE00E943504DF91CF911F9151 +:1009E0000F91FF90EF9008950F931F938C01AB012F +:1009F000662757FD6095762F0E94CD04C8010E949E +:100A00001E041F910F910895629FD001739FF00102 +:100A1000829FE00DF11D649FE00DF11D929FF00D8E +:100A2000839FF00D749FF00D659FF00D9927729FC5 +:100A3000B00DE11DF91F639FB00DE11DF91FBD0150 +:100A4000CF011124089597FB092E07260AD077FDC0 +:100A500004D049D006D000201AF4709561957F4FDC +:100A60000895F6F7909581959F4F0895A1E21A2E6B +:100A7000AA1BBB1BFD010DC0AA1FBB1FEE1FFF1F42 +:100A8000A217B307E407F50720F0A21BB30BE40B92 +:100A9000F50B661F771F881F991F1A9469F76095D9 +:100AA0007095809590959B01AC01BD01CF01089593 +:100AB00097FB092E05260ED057FD04D0D7DF0AD0AC +:100AC000001C38F450954095309521953F4F4F4F7D +:100AD0005F4F0895F6F790958095709561957F4FDB +:100AE0008F4F9F4F0895AA1BBB1B51E107C0AA1F40 +:100AF000BB1FA617B70710F0A61BB70B881F991FBF +:100B00005A95A9F780959095BC01CD010895EE0FF7 +:0E0B1000FF1F0590F491E02D0994F894FFCF9B +:0E0B1E000B000C00000000009A03E703FF0329 +:00000001FF diff --git a/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.o b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.o new file mode 100644 index 0000000..5d7e09c Binary files /dev/null and b/arduino/sketch_nov03a/applet/sketch_nov03a.cpp.o differ diff --git a/arduino/sketch_nov03a/applet/wiring.c.o b/arduino/sketch_nov03a/applet/wiring.c.o new file mode 100644 index 0000000..450a0e1 Binary files /dev/null and b/arduino/sketch_nov03a/applet/wiring.c.o differ diff --git a/arduino/sketch_nov03a/applet/wiring_analog.c.o b/arduino/sketch_nov03a/applet/wiring_analog.c.o new file mode 100644 index 0000000..fbc3d62 Binary files /dev/null and b/arduino/sketch_nov03a/applet/wiring_analog.c.o differ diff --git a/arduino/sketch_nov03a/applet/wiring_digital.c.o b/arduino/sketch_nov03a/applet/wiring_digital.c.o new file mode 100644 index 0000000..1f02e56 Binary files /dev/null and b/arduino/sketch_nov03a/applet/wiring_digital.c.o differ diff --git a/arduino/sketch_nov03a/applet/wiring_pulse.c.o b/arduino/sketch_nov03a/applet/wiring_pulse.c.o new file mode 100644 index 0000000..58b5465 Binary files /dev/null and b/arduino/sketch_nov03a/applet/wiring_pulse.c.o differ diff --git a/arduino/sketch_nov03a/applet/wiring_shift.c.o b/arduino/sketch_nov03a/applet/wiring_shift.c.o new file mode 100644 index 0000000..9c3045a Binary files /dev/null and b/arduino/sketch_nov03a/applet/wiring_shift.c.o differ diff --git a/arduino/sketch_nov03a/sketch_nov03a.pde b/arduino/sketch_nov03a/sketch_nov03a.pde new file mode 100644 index 0000000..df7bd6c --- /dev/null +++ b/arduino/sketch_nov03a/sketch_nov03a.pde @@ -0,0 +1,65 @@ +#include +#include + + +int pinA = 11; +int pinB = 12; +int ledPin = 13; + +void setup() { + //Timer2 Settings + TCCR2A = 0; + TCCR2B = 0<>1); + } + + val_alt = val; + + delay(100); + digitalWrite(13,LOW); + delay(100); +} diff --git a/arduino/sketch_oct13b/applet/HardwareSerial.cpp.o b/arduino/sketch_oct13b/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..690d98e Binary files /dev/null and b/arduino/sketch_oct13b/applet/HardwareSerial.cpp.o differ diff --git a/arduino/sketch_oct13b/applet/Print.cpp.o b/arduino/sketch_oct13b/applet/Print.cpp.o new file mode 100644 index 0000000..624fc06 Binary files /dev/null and b/arduino/sketch_oct13b/applet/Print.cpp.o differ diff --git a/arduino/sketch_oct13b/applet/WInterrupts.c.o b/arduino/sketch_oct13b/applet/WInterrupts.c.o new file mode 100644 index 0000000..10fbd46 Binary files /dev/null and b/arduino/sketch_oct13b/applet/WInterrupts.c.o differ diff --git a/arduino/sketch_oct13b/applet/WMath.cpp.o b/arduino/sketch_oct13b/applet/WMath.cpp.o new file mode 100644 index 0000000..c2fe7dd Binary files /dev/null and b/arduino/sketch_oct13b/applet/WMath.cpp.o differ diff --git a/arduino/sketch_oct13b/applet/core.a b/arduino/sketch_oct13b/applet/core.a new file mode 100644 index 0000000..1daf5f6 Binary files /dev/null and b/arduino/sketch_oct13b/applet/core.a differ diff --git a/arduino/sketch_oct13b/applet/pins_arduino.c.o b/arduino/sketch_oct13b/applet/pins_arduino.c.o new file mode 100644 index 0000000..f851e85 Binary files /dev/null and b/arduino/sketch_oct13b/applet/pins_arduino.c.o differ diff --git a/arduino/sketch_oct13b/applet/sketch_oct13b.cpp b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp new file mode 100644 index 0000000..8c7a389 --- /dev/null +++ b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp @@ -0,0 +1,63 @@ +#include "WProgram.h" +void setup(); +void loop(); +int pinA = 11; +int pinB = 12; +int pinLED = 13; + +void setup() { + Serial.begin(9600); + pinMode(pinA, INPUT); + digitalWrite(pinA, HIGH); + pinMode(pinB, INPUT); + digitalWrite(pinB, HIGH); + pinMode(pinLED, OUTPUT); +} + +int a_old, b_old, dreh; + + + + + +void loop() { + // shall we blink + // if (millis() - prevMillis > 100) { + // prevMillis = millis(); + // + // if (pinLEDstate == LOW) + // pinLEDstate = HIGH; + // else + // pinLEDstate = LOW; + // digitalWrite(pinLED, pinLEDstate); + // + int a = digitalRead(pinA); + int b = digitalRead(pinB); + + if (a != a_old || b != b_old) { + Serial.print(digitalRead(pinA)); + Serial.print(" "); + Serial.print(digitalRead(pinB)); + Serial.println(); + dreh++; + // Serial.println("C:> _"); + } + + digitalWrite(pinLED, a); + a_old = a; + b_old = b; +} + + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.eep b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.elf b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.elf new file mode 100755 index 0000000..1fa2f23 Binary files /dev/null and b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.elf differ diff --git a/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.hex b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.hex new file mode 100644 index 0000000..01ab543 --- /dev/null +++ b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.hex @@ -0,0 +1,178 @@ +:100000000C9462000C948A000C948A000C948A0070 +:100010000C948A000C948A000C948A000C948A0038 +:100020000C948A000C948A000C948A000C948A0028 +:100030000C948A000C948A000C948A000C948A0018 +:100040000C94C4010C948A000C9446020C948A000F +:100050000C948A000C948A000C948A000C948A00F8 +:100060000C948A000C948A000000000024002700F1 +:100070002A0000000000250028002B0000000000DE +:1000800023002600290004040404040404040202DA +:100090000202020203030303030301020408102007 +:1000A0004080010204081020010204081020000012 +:1000B0000007000201000003040600000000000029 +:1000C00000008F0311241FBECFEFD4E0DEBFCDBFF1 +:1000D00011E0A0E0B1E0E2EEFAE002C005900D927E +:1000E000A231B107D9F711E0A2E1B1E001C01D9240 +:1000F000A83BB107E1F710E0C4ECD0E004C02297C0 +:10010000FE010E946B05C23CD107C9F70E940101A4 +:100110000C946F050C9400000F931F93CF93DF9303 +:10012000809102010E947501EC01809104010E94FE +:1001300075018C018091120190911301C817D907A4 +:1001400039F480911401909115010817190729F1CC +:10015000809102010E947501BC0185EA91E00E9434 +:10016000DE0485EA91E060E071E00E940004809185 +:1001700004010E947501BC0185EA91E00E94DE0441 +:1001800085EA91E00E940804809116019091170180 +:1001900001969093170180931601809106016C2FB0 +:1001A0000E942801D0931301C093120110931501EE +:1001B00000931401DF91CF911F910F91089585EA6B +:1001C00091E040E855E260E070E00E948302809197 +:1001D000020160E00E9408018091020161E00E943A +:1001E00028018091040160E00E94080180910401CF +:1001F00061E00E9428018091060161E00E940801EF +:1002000008950E940C020E94DF000E948C00FDCF26 +:10021000282F30E0C90186569F4FFC0194912A5740 +:100220003F4FF9018491882391F0E82FF0E0EE0F21 +:10023000FF1FE859FF4FA591B491662329F48C91D3 +:10024000909589238C9308958C91892B8C93089594 +:10025000482F50E0CA0182559F4FFC012491CA01EA +:1002600086569F4FFC0194914A575F4FFA01349193 +:100270003323D1F1222331F1233021F48091800006 +:100280008F7705C0243031F4809180008F7D80937A +:10029000800018C0213019F484B58F7704C0223053 +:1002A00021F484B58F7D84BD0DC0263021F480916A +:1002B000B0008F7705C0273029F48091B0008F7D82 +:1002C0008093B000E32FF0E0EE0FFF1FEE58FF4FDA +:1002D000A591B491662329F48C91909589238C93F0 +:1002E00008958C91892B8C930895682F70E0CB0131 +:1002F00082559F4FFC012491CB0186569F4FFC01F4 +:1003000044916A577F4FFB019491992319F420E09F +:1003100030E038C0222331F1233021F48091800075 +:100320008F7705C0243031F4809180008F7D8093D9 +:10033000800018C0213019F484B58F7704C02230B2 +:1003400021F484B58F7D84BD0DC0263021F48091C9 +:10035000B0008F7705C0273029F48091B0008F7DE1 +:100360008093B000892F90E0880F991F84589F4F89 +:10037000FC01A591B4918C9120E030E0842311F030 +:1003800021E030E0C90108951F920F920FB60F923D +:1003900011242F933F938F939F93AF93BF9380919B +:1003A0001C0190911D01A0911E01B0911F0130917F +:1003B00020010196A11DB11D232F2D5F2D3720F0A7 +:1003C0002D570196A11DB11D2093200180931C0182 +:1003D00090931D01A0931E01B0931F0180911801FD +:1003E00090911901A0911A01B0911B010196A11DD4 +:1003F000B11D8093180190931901A0931A01B09335 +:100400001B01BF91AF919F918F913F912F910F90C1 +:100410000FBE0F901F901895789484B5826084BDAC +:1004200084B5816084BD85B5826085BD85B58160F8 +:1004300085BDEEE6F0E0808181608083E1E8F0E058 +:10044000808182608083808181608083E0E8F0E049 +:10045000808181608083E1EBF0E080818460808333 +:10046000E0EBF0E0808181608083EAE7F0E080816A +:1004700084608083808182608083808181608083CA +:100480008081806880831092C10008951F920F922E +:100490000FB60F9211242F933F934F935F936F9357 +:1004A0007F938F939F93AF93BF93EF93FF9340916D +:1004B000C600E091A101F091A201CF01019660E890 +:1004C00070E00E9405059C018091A3019091A40118 +:1004D0002817390739F0EF5DFE4F40833093A201B2 +:1004E0002093A101FF91EF91BF91AF919F918F91C7 +:1004F0007F916F915F914F913F912F910F900FBE20 +:100500000F901F9018955F926F927F928F929F929B +:10051000AF92BF92CF92DF92EF92FF920F931F9311 +:10052000CF93DF93EC013A014B01413482E4580749 +:100530008FE0680780E078070CF07FC060E874E81F +:100540008EE190E0A40193010E943A0521503040D1 +:1005500040405040CA01B90122E030E040E050E0A4 +:100560000E943A0559016A01A6019501209530952E +:100570004095509594E0220F331F441F551F9A95C4 +:10058000D1F760E074E284EF90E00E943A05CA017E +:10059000B9012FEF30E040E050E00E94E604A401F2 +:1005A00093010E943A05C90181509F4F1816190600 +:1005B0001CF4522E5A9403C055245394521A60E0EE +:1005C00079E08DE390E0A40193010E943A05215067 +:1005D000304040405040CA01B90122E030E040E0E4 +:1005E00050E00E943A05209530954095509583E063 +:1005F000220F331F441F551F8A95D1F760E074E224 +:1006000084EF90E00E943A05CA01B9012FEF30E073 +:1006100040E050E00E94E604A40193010E943A05E4 +:10062000C90181509F4F181619061CF4822F815062 +:1006300002C081E0821B851500F5E885F98581E01F +:1006400090E00A8802C0880F991F0A94E2F780831D +:1006500060E079E08DE390E0A40193010E943A0507 +:100660002150304040405040CA01B90122E030E002 +:1006700040E050E00E943A0504C0E885F985108208 +:100680009501EC81FD813083EE81FF812083EA8535 +:10069000FB85208141E050E0CA010E8402C0880F32 +:1006A000991F0A94E2F7282B2083EA85FB85208195 +:1006B000CA010F8402C0880F991F0A94E2F7282B01 +:1006C0002083EA85FB858081088802C0440F551F7E +:1006D0000A94E2F7842B8083DF91CF911F910F91D1 +:1006E000FF90EF90DF90CF90BF90AF909F908F9052 +:1006F0007F906F905F900895FC01A085B18521895E +:100700008C9190E0022E02C0959587950A94E2F7AD +:1007100080FFF6CF0484F585E02D608308958CE09A +:1007200091E09093A6018093A50181E291E09093DE +:10073000A8018093A70185EC90E09093AA01809393 +:10074000A90184EC90E09093AC018093AB0180EC24 +:1007500090E09093AE018093AD0181EC90E0909396 +:10076000B0018093AF0186EC90E09093B20180934A +:10077000B10184E08093B30183E08093B40187E00A +:100780008093B50185E08093B60181E08093B70145 +:1007900008950F931F93CF93DF938C01EB0109C052 +:1007A0002196D801ED91FC910190F081E02DC801D6 +:1007B000099568816623A1F7DF91CF911F910F9171 +:1007C0000895EF92FF920F931F93CF93DF938C01C5 +:1007D0007B01EA010CC0D7016D917D01D801ED913B +:1007E000FC910190F081E02DC80109952197209797 +:1007F00091F7DF91CF911F910F91FF90EF900895A6 +:10080000DC01ED91FC910280F381E02D09950895C2 +:100810000F931F938C01DC01ED91FC910190F0810D +:10082000E02D6DE00995D801ED91FC910190F081EA +:10083000E02DC8016AE009951F910F9108952F924C +:100840003F924F925F926F927F928F929F92AF9260 +:10085000BF92CF92DF92EF92FF920F931F93DF939D +:10086000CF93CDB7DEB7A0970FB6F894DEBF0FBE1B +:10087000CDBF1C016A017B01411551056105710560 +:1008800049F4DC01ED91FC910190F081E02D60E3F1 +:10089000099554C0882499245401422E5524662475 +:1008A000772401E010E00C0F1D1F080D191DC70172 +:1008B000B601A30192010E941805F8016083089413 +:1008C000811C911CA11CB11CC701B601A30192019E +:1008D0000E941805C901DA016C017D01C114D1041F +:1008E000E104F104F1F681E0E82EF12CEC0EFD1E9E +:1008F000E80CF91C3E010894611C711CD501C4016F +:100900000197A109B1096C01C818D90814C0F601F2 +:10091000EE0DFF1D60816A3010F4605D01C0695CFE +:10092000D101ED91FC910190F081E02DC10109957B +:100930000894E108F1086E147F0449F7A0960FB6F9 +:10094000F894DEBF0FBECDBFCF91DF911F910F9105 +:10095000FF90EF90DF90CF90BF90AF909F908F90DF +:100960007F906F905F904F903F902F900895EF92FF +:10097000FF920F931F93CF93DF93EC017A018B01CA +:1009800077FF0FC0E881F9810190F081E02D6DE2E1 +:10099000099510950095F094E094E11CF11C011D5F +:1009A000111DCE01B801A7012AE00E941F04DF91AA +:1009B000CF911F910F91FF90EF900895AB016627A3 +:1009C00057FD6095762F0E94B7040895629FD0016D +:1009D000739FF001829FE00DF11D649FE00DF11DFA +:1009E000929FF00D839FF00D749FF00D659FF00DA9 +:1009F0009927729FB00DE11DF91F639FB00DE11D96 +:100A0000F91FBD01CF011124089597FB092E072678 +:100A10000AD077FD04D049D006D000201AF4709592 +:100A200061957F4F0895F6F7909581959F4F0895B2 +:100A3000A1E21A2EAA1BBB1BFD010DC0AA1FBB1FE2 +:100A4000EE1FFF1FA217B307E407F50720F0A21B54 +:100A5000B30BE40BF50B661F771F881F991F1A94C1 +:100A600069F760957095809590959B01AC01BD01EB +:100A7000CF01089597FB092E05260ED057FD04D00F +:100A8000D7DF0AD0001C38F4509540953095219559 +:100A90003F4F4F4F5F4F0895F6F7909580957095B3 +:100AA00061957F4F8F4F9F4F0895AA1BBB1B51E14C +:100AB00007C0AA1FBB1FA617B70710F0A61BB70BCE +:100AC000881F991F5A95A9F780959095BC01CD0173 +:100AD0000895EE0FFF1F0590F491E02D0994F8940E +:020AE000FFCF46 +:100AE20020000B000C000D00000000007C03C90375 +:020AF200E1031E +:00000001FF diff --git a/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.o b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.o new file mode 100644 index 0000000..1b7e296 Binary files /dev/null and b/arduino/sketch_oct13b/applet/sketch_oct13b.cpp.o differ diff --git a/arduino/sketch_oct13b/applet/wiring.c.o b/arduino/sketch_oct13b/applet/wiring.c.o new file mode 100644 index 0000000..450a0e1 Binary files /dev/null and b/arduino/sketch_oct13b/applet/wiring.c.o differ diff --git a/arduino/sketch_oct13b/applet/wiring_analog.c.o b/arduino/sketch_oct13b/applet/wiring_analog.c.o new file mode 100644 index 0000000..fbc3d62 Binary files /dev/null and b/arduino/sketch_oct13b/applet/wiring_analog.c.o differ diff --git a/arduino/sketch_oct13b/applet/wiring_digital.c.o b/arduino/sketch_oct13b/applet/wiring_digital.c.o new file mode 100644 index 0000000..1f02e56 Binary files /dev/null and b/arduino/sketch_oct13b/applet/wiring_digital.c.o differ diff --git a/arduino/sketch_oct13b/applet/wiring_pulse.c.o b/arduino/sketch_oct13b/applet/wiring_pulse.c.o new file mode 100644 index 0000000..58b5465 Binary files /dev/null and b/arduino/sketch_oct13b/applet/wiring_pulse.c.o differ diff --git a/arduino/sketch_oct13b/applet/wiring_shift.c.o b/arduino/sketch_oct13b/applet/wiring_shift.c.o new file mode 100644 index 0000000..9c3045a Binary files /dev/null and b/arduino/sketch_oct13b/applet/wiring_shift.c.o differ diff --git a/arduino/sketch_oct13b/sketch_oct13b.pde b/arduino/sketch_oct13b/sketch_oct13b.pde new file mode 100644 index 0000000..855b75d --- /dev/null +++ b/arduino/sketch_oct13b/sketch_oct13b.pde @@ -0,0 +1,47 @@ +int pinA = 11; +int pinB = 12; +int pinLED = 13; + +void setup() { + Serial.begin(9600); + pinMode(pinA, INPUT); + digitalWrite(pinA, HIGH); + pinMode(pinB, INPUT); + digitalWrite(pinB, HIGH); + pinMode(pinLED, OUTPUT); +} + +int a_old, b_old, dreh; + + + + + +void loop() { + // shall we blink + // if (millis() - prevMillis > 100) { + // prevMillis = millis(); + // + // if (pinLEDstate == LOW) + // pinLEDstate = HIGH; + // else + // pinLEDstate = LOW; + // digitalWrite(pinLED, pinLEDstate); + // + int a = digitalRead(pinA); + int b = digitalRead(pinB); + + if (a != a_old || b != b_old) { + Serial.print(digitalRead(pinA)); + Serial.print(" "); + Serial.print(digitalRead(pinB)); + Serial.println(); + dreh++; + // Serial.println("C:> _"); + } + + digitalWrite(pinLED, a); + a_old = a; + b_old = b; +} + diff --git a/arduino/sketch_oct20a/applet/HardwareSerial.cpp.o b/arduino/sketch_oct20a/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..690d98e Binary files /dev/null and b/arduino/sketch_oct20a/applet/HardwareSerial.cpp.o differ diff --git a/arduino/sketch_oct20a/applet/LCD4Bit/LCD4Bit.cpp.o b/arduino/sketch_oct20a/applet/LCD4Bit/LCD4Bit.cpp.o new file mode 100644 index 0000000..2832ef8 Binary files /dev/null and b/arduino/sketch_oct20a/applet/LCD4Bit/LCD4Bit.cpp.o differ diff --git a/arduino/sketch_oct20a/applet/Print.cpp.o b/arduino/sketch_oct20a/applet/Print.cpp.o new file mode 100644 index 0000000..624fc06 Binary files /dev/null and b/arduino/sketch_oct20a/applet/Print.cpp.o differ diff --git a/arduino/sketch_oct20a/applet/WInterrupts.c.o b/arduino/sketch_oct20a/applet/WInterrupts.c.o new file mode 100644 index 0000000..10fbd46 Binary files /dev/null and b/arduino/sketch_oct20a/applet/WInterrupts.c.o differ diff --git a/arduino/sketch_oct20a/applet/WMath.cpp.o b/arduino/sketch_oct20a/applet/WMath.cpp.o new file mode 100644 index 0000000..c2fe7dd Binary files /dev/null and b/arduino/sketch_oct20a/applet/WMath.cpp.o differ diff --git a/arduino/sketch_oct20a/applet/core.a b/arduino/sketch_oct20a/applet/core.a new file mode 100644 index 0000000..7f6c41c Binary files /dev/null and b/arduino/sketch_oct20a/applet/core.a differ diff --git a/arduino/sketch_oct20a/applet/pins_arduino.c.o b/arduino/sketch_oct20a/applet/pins_arduino.c.o new file mode 100644 index 0000000..f851e85 Binary files /dev/null and b/arduino/sketch_oct20a/applet/pins_arduino.c.o differ diff --git a/arduino/sketch_oct20a/applet/sketch_oct20a.cpp b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp new file mode 100644 index 0000000..bac69a7 --- /dev/null +++ b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp @@ -0,0 +1,54 @@ +#include +#include "WProgram.h" +void setup(); +void loop(); +LCD4Bit lcd = LCD4Bit(2); + +void setup() { + lcd.init(); + lcd.clear(); + lcd.printIn("World Arduinination in progress..."); +} + +int i = 0,j = 0, dir = 1; +char bfr[4]; + +void loop() { + digitalWrite(13, HIGH); + + lcd.cursorTo(2, 0); + itoa(i, bfr, 10); + lcd.printIn(bfr); + lcd.printIn("%"); + + lcd.cursorTo(2, 4); + + for(j=0; j < (i / 3); j++) + lcd.print(255); + for(j=i/3; j < 100/3; j++) + lcd.printIn(" "); + + + if(i >= 98) + dir = -1; + if(dir == -1 && i <= 80) + dir = 1; + + i += dir; + + digitalWrite(13,LOW); + delay(100); +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.eep b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.elf b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.elf new file mode 100755 index 0000000..beee751 Binary files /dev/null and b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.elf differ diff --git a/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.hex b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.hex new file mode 100644 index 0000000..bacdf37 --- /dev/null +++ b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.hex @@ -0,0 +1,151 @@ +:100000000C9462000C948A000C948A000C948A0070 +:100010000C948A000C948A000C948A000C948A0038 +:100020000C948A000C948A000C948A000C948A0028 +:100030000C948A000C948A000C948A000C948A0018 +:100040000C94A3030C948A000C948A000C948A00EC +:100050000C948A000C948A000C948A000C948A00F8 +:100060000C948A000C948A000000000024002700F1 +:100070002A0000000000250028002B0000000000DE +:1000800023002600290004040404040404040202DA +:100090000202020203030303030301020408102007 +:1000A0004080010204081020010204081020000012 +:1000B0000007000201000003040600000000000029 +:1000C00000007D0211241FBECFEFD4E0DEBFCDBF04 +:1000D00011E0A0E0B1E0E8E1F9E002C005900D9286 +:1000E000AA33B107D9F711E0AAE3B1E001C01D922C +:1000F000AE34B107E1F710E0C4ECD0E004C02297C1 +:10010000FE010E948604C23CD107C9F70E942F035A +:100110000C948A040C940000FB019F01E894423087 +:10012000C4F04532B4F44A3029F497FB1EF490959C +:1001300081959F4F642F77270E947004805D8A33DA +:100140000CF0895D8193CB010097A1F716F45DE275 +:1001500051931082C9010C94AD00DC01FC01672FA2 +:1001600071917723E1F7329704C07C916D9370838E +:100170006291AE17BF07C8F308957093360160937C +:100180003501615070406230710530F081E090E0DF +:100190009093360180933501089580912B0160E0A2 +:1001A0000E94560381E090E00E94150480912B018B +:1001B00061E00E94560381E090E00E941504809166 +:1001C0002B0160E00E94560361E070E080E090E067 +:1001D0000E94EB030895EF92FF920F931F93CF932A +:1001E000DF937C018B010F701070C0912D01D091B5 +:1001F0002E0108C0602F61708C2F0E945603159548 +:100200000795219680913301909134018C179D07B9 +:100210008CF7C7010E94CD00DF91CF911F910F9104 +:10022000FF90EF900895EF92FF920F931F938C0130 +:100230007B0194E0759567959A95E1F7C8010E9456 +:10024000EB008FE0E822FF24C801B7010E94EB0019 +:100250001F910F91FF90EF9008950F931F93CF93ED +:10026000DF93EC018B018091270160E00E9456032F +:1002700080913A0190913B01892B29F080912901CD +:1002800060E00E945603CE01B8010E94EB00DF91AE +:10029000CF911F910F9108950F931F93CF93DF93E9 +:1002A000EC018B018091270161E00E94560380914F +:1002B0003A0190913B01892B29F08091290160E05E +:1002C0000E945603CE01B8010E941301DF91CF9125 +:1002D0001F910F910895CF92DF92FF920F931F937A +:1002E000CF93DF936C018B01FF240AC0C00FD11F95 +:1002F0006881772767FD7095C6010E944C01F394D1 +:10030000CF2DD0E0F80101900020E9F73197E01BF4 +:10031000F10BCE17DF0750F3DF91CF911F910F91B3 +:10032000FF90DF90CF9008950F931F93CF93DF93AB +:10033000EC018B018091270160E00E9456038091BF +:100340003A0190913B01892B29F08091290160E0CD +:100350000E945603CE01B8010E941301DF91CF9194 +:100360001F910F910895EF92FF920F931F93CF93D8 +:10037000DF937C01EB018A0162E070E00E9494014E +:1003800062E070E080E090E00E94EB038091350134 +:1003900090913601019721F0229711F4085D1F4FCB +:1003A000C0E0D0E006C0C70164E170E00E949401A3 +:1003B0002196C017D107BCF3DF91CF911F910F9108 +:1003C000FF90EF900895CF93DF93EC0180912B0184 +:1003D00061E00E9436038091270161E00E943603AC +:1003E00080913A0190913B01892B29F0809129015C +:1003F00061E00E94360380912D0161E00E94360386 +:1004000080912F0161E00E9436038091310161E00B +:100410000E9436038091330161E00E94360362E35B +:1004200070E080E090E00E94EB03CE0163E070E0BA +:100430000E942D0165E070E080E090E00E94EB03F7 +:10044000CE0163E070E00E942D0184E690E00E94FE +:100450001504CE0163E070E00E942D0165E070E0BC +:1004600080E090E00E94EB03CE0162E070E00E9429 +:100470002D01CE0162E070E00E942D0160913501F6 +:10048000709136016150704023E0660F771F2A9506 +:10049000E1F7CE010E942D018CE390E00E9415044B +:1004A000CE016CE070E00E9494018CE390E00E9429 +:1004B0001504CE0161E070E00E94940163E070E0F9 +:1004C00080E090E00E94EB03CE0166E070E00E94C5 +:1004D000940161E070E080E090E00E94EB03DF9126 +:1004E000CF91089561E070E00E94940161E070E0B6 +:1004F00080E090E00E94EB0308958CE391E062E0DD +:1005000070E00E94BD0008958DE061E00E945603F6 +:100510008CE391E062E070E040E050E00E94B301C3 +:1005200080913D0190913E0161E471E04AE050E02C +:100530000E948C008CE391E061E471E00E946B0109 +:100540008CE391E060E071E00E946B018CE391E04C +:1005500062E070E044E050E00E94B301109240017C +:1005600010923F010FC08CE391E06FEF70E00E94AA +:100570004C0180913F019091400101969093400180 +:1005800080933F0180913D0190913E0163E070E0D6 +:100590000E945D0480913F0190914001861797076A +:1005A00014F37093400160933F010FC08CE391E01E +:1005B00062E071E00E946B0180913F0190914001E7 +:1005C00001969093400180933F0180913F0190916B +:1005D000400181975CF320913D0130913E0122362C +:1005E000310534F08FEF9FEF9093380180933701FE +:1005F00080913701909138018F5F9F4F49F42135E9 +:10060000310534F481E090E0909338018093370114 +:100610008091370190913801820F931F90933E0192 +:1006200080933D018DE060E00E94560364E670E037 +:1006300080E090E00E94EB0308950F931F930CE37A +:1006400011E0C8010E94E301C8010E947202C801C2 +:1006500064E071E00E946B011F910F9108950E9468 +:1006600023040E941D030E948402FDCF282F30E046 +:10067000C90186569F4FFC0194912A573F4FF901BB +:100680008491882391F0E82FF0E0EE0FFF1FE859E6 +:10069000FF4FA591B491662329F48C9190958923FD +:1006A0008C9308958C91892B8C930895482F50E05A +:1006B000CA0182559F4FFC012491CA0186569F4F63 +:1006C000FC0194914A575F4FFA0134913323D1F1E1 +:1006D000222331F1233021F4809180008F7705C0EF +:1006E000243031F4809180008F7D8093800018C089 +:1006F000213019F484B58F7704C0223021F484B5F9 +:100700008F7D84BD0DC0263021F48091B0008F779D +:1007100005C0273029F48091B0008F7D8093B00010 +:10072000E32FF0E0EE0FFF1FEE58FF4FA591B491BD +:10073000662329F48C91909589238C9308958C914C +:10074000892B8C9308951F920F920FB60F9211244C +:100750002F933F938F939F93AF93BF9380914901C2 +:1007600090914A01A0914B01B0914C0130914D0103 +:100770000196A11DB11D232F2D5F2D3720F02D5780 +:100780000196A11DB11D20934D01809349019093C5 +:100790004A01A0934B01B0934C0180914501909187 +:1007A0004601A0914701B09148010196A11DB11DDC +:1007B0008093450190934601A0934701B09348016F +:1007C000BF91AF919F918F913F912F910F900FBE4D +:1007D0000F901F901895EF92FF920F931F937B013C +:1007E0008C018FB7F8944091490150914A01609172 +:1007F0004B0170914C018FBF2FB7F8948091490144 +:1008000090914A01A0914B01B0914C012FBF841BE4 +:10081000950BA60BB70BE816F9060A071B0760F73E +:100820001F910F91FF90EF900895019759F0FC01EF +:10083000EE0FFF1FEE0FFF1F32978FB7F89431971F +:10084000F1F78FBF0895789484B5826084BD84B534 +:10085000816084BD85B5826085BD85B5816085BDBB +:10086000EEE6F0E0808181608083E1E8F0E0808165 +:1008700082608083808181608083E0E8F0E0808115 +:1008800081608083E1EBF0E0808184608083E0EB35 +:10089000F0E0808181608083EAE7F0E0808184601D +:1008A0008083808182608083808181608083808179 +:1008B000806880831092C100089597FB092E072657 +:1008C0000AD077FD04D00CD006D000201AF4709521 +:1008D00061957F4F0895F6F7909581959F4F089504 +:1008E000AA1BBB1B51E107C0AA1FBB1FA617B70756 +:1008F00010F0A61BB70B881F991F5A95A9F7809572 +:100900009095BC01CD010895EE0FFF1F0590F49165 +:08091000E02D0994F894FFCFDB +:1009180025002000576F726C642041726475696EFF +:10092800696E6174696F6E20696E2070726F67728C +:100938006573732E2E2E0002007F0003000400054D +:0A0948000006000700020001000095 +:00000001FF diff --git a/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.o b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.o new file mode 100644 index 0000000..a2275e9 Binary files /dev/null and b/arduino/sketch_oct20a/applet/sketch_oct20a.cpp.o differ diff --git a/arduino/sketch_oct20a/applet/wiring.c.o b/arduino/sketch_oct20a/applet/wiring.c.o new file mode 100644 index 0000000..450a0e1 Binary files /dev/null and b/arduino/sketch_oct20a/applet/wiring.c.o differ diff --git a/arduino/sketch_oct20a/applet/wiring_analog.c.o b/arduino/sketch_oct20a/applet/wiring_analog.c.o new file mode 100644 index 0000000..fbc3d62 Binary files /dev/null and b/arduino/sketch_oct20a/applet/wiring_analog.c.o differ diff --git a/arduino/sketch_oct20a/applet/wiring_digital.c.o b/arduino/sketch_oct20a/applet/wiring_digital.c.o new file mode 100644 index 0000000..1f02e56 Binary files /dev/null and b/arduino/sketch_oct20a/applet/wiring_digital.c.o differ diff --git a/arduino/sketch_oct20a/applet/wiring_pulse.c.o b/arduino/sketch_oct20a/applet/wiring_pulse.c.o new file mode 100644 index 0000000..58b5465 Binary files /dev/null and b/arduino/sketch_oct20a/applet/wiring_pulse.c.o differ diff --git a/arduino/sketch_oct20a/applet/wiring_shift.c.o b/arduino/sketch_oct20a/applet/wiring_shift.c.o new file mode 100644 index 0000000..9c3045a Binary files /dev/null and b/arduino/sketch_oct20a/applet/wiring_shift.c.o differ diff --git a/arduino/sketch_oct20a/sketch_oct20a.pde b/arduino/sketch_oct20a/sketch_oct20a.pde new file mode 100644 index 0000000..9b82454 --- /dev/null +++ b/arduino/sketch_oct20a/sketch_oct20a.pde @@ -0,0 +1,38 @@ +#include +LCD4Bit lcd = LCD4Bit(2); + +void setup() { + lcd.init(); + lcd.clear(); + lcd.printIn("World Arduinination in progress..."); +} + +int i = 0,j = 0, dir = 1; +char bfr[4]; + +void loop() { + digitalWrite(13, HIGH); + + lcd.cursorTo(2, 0); + itoa(i, bfr, 10); + lcd.printIn(bfr); + lcd.printIn("%"); + + lcd.cursorTo(2, 4); + + for(j=0; j < (i / 3); j++) + lcd.print(255); + for(j=i/3; j < 100/3; j++) + lcd.printIn(" "); + + + if(i >= 98) + dir = -1; + if(dir == -1 && i <= 80) + dir = 1; + + i += dir; + + digitalWrite(13,LOW); + delay(100); +} diff --git a/arduino/sketch_oct27a/sketch_oct27a.pde b/arduino/sketch_oct27a/sketch_oct27a.pde new file mode 100644 index 0000000..eca659e --- /dev/null +++ b/arduino/sketch_oct27a/sketch_oct27a.pde @@ -0,0 +1,43 @@ +#include +LCD4Bit lcd = LCD4Bit(2); + +void setup() { + lcd.init(); + lcd.clear(); + + // create char + lcd.commandWrite(0x40); + lcd.print(0b10001); + lcd.print(0b01010); + lcd.print(0b10101); + lcd.print(0b11111); + lcd.print(0b01110); + lcd.print(0b10001); + lcd.print(0b10001); + lcd.print(0b01010); + + // back to normal + lcd.cursorTo(1,0); + for(uint8_t i = 0; i < 80; i++) { + lcd.print(0x00+(i&0x7)); + } + +} + +void loop() { + digitalWrite(13, HIGH); + + lcd.commandWrite(0x40+8*random(8)); + uint8_t fnord = random(8); + for (uint8_t i = 0; i<8; i++) { + if(i == fnord) { + lcd.print(0b11111); + } else { + lcd.print(0b00000); + } + } + + digitalWrite(13,LOW); + delay(10); +} + diff --git a/arduino/sketch_sep15b/applet/HardwareSerial.cpp.o b/arduino/sketch_sep15b/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..690d98e Binary files /dev/null and b/arduino/sketch_sep15b/applet/HardwareSerial.cpp.o differ diff --git a/arduino/sketch_sep15b/applet/Print.cpp.o b/arduino/sketch_sep15b/applet/Print.cpp.o new file mode 100644 index 0000000..624fc06 Binary files /dev/null and b/arduino/sketch_sep15b/applet/Print.cpp.o differ diff --git a/arduino/sketch_sep15b/applet/WInterrupts.c.o b/arduino/sketch_sep15b/applet/WInterrupts.c.o new file mode 100644 index 0000000..10fbd46 Binary files /dev/null and b/arduino/sketch_sep15b/applet/WInterrupts.c.o differ diff --git a/arduino/sketch_sep15b/applet/WMath.cpp.o b/arduino/sketch_sep15b/applet/WMath.cpp.o new file mode 100644 index 0000000..c2fe7dd Binary files /dev/null and b/arduino/sketch_sep15b/applet/WMath.cpp.o differ diff --git a/arduino/sketch_sep15b/applet/core.a b/arduino/sketch_sep15b/applet/core.a new file mode 100644 index 0000000..0aad643 Binary files /dev/null and b/arduino/sketch_sep15b/applet/core.a differ diff --git a/arduino/sketch_sep15b/applet/pins_arduino.c.o b/arduino/sketch_sep15b/applet/pins_arduino.c.o new file mode 100644 index 0000000..f851e85 Binary files /dev/null and b/arduino/sketch_sep15b/applet/pins_arduino.c.o differ diff --git a/arduino/sketch_sep15b/applet/sketch_sep15b.cpp b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp new file mode 100644 index 0000000..d0d2d3a --- /dev/null +++ b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp @@ -0,0 +1,47 @@ +#include "WProgram.h" +void setup(); +void loop(); +int ledPin = 11; +int foo = 0; +int dir = 1; +int fnord = 0; + +int loga[32] = {0, 1, 2, 2, 2, 3, 3, 4, 5, 6, 7, 8, 10, 11, + 13, 16, 19, 23, 27, 32, 38, 45, 54, 64, 76, + 91, 108, 128, 152, 181, 215, 255}; + + +void setup() { + pinMode(ledPin, OUTPUT); + pinMode(7, INPUT); +} + +void loop() { + analogWrite(ledPin, loga[foo]); + fnord = digitalRead(7); + delay(100); + + if (fnord) { + foo += dir; + } + if (foo >= 31) { + dir = -1; + } + + if (foo <= 0) { + dir = +1; + } +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.eep b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.elf b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.elf new file mode 100755 index 0000000..48641a3 Binary files /dev/null and b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.elf differ diff --git a/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.hex b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.hex new file mode 100644 index 0000000..a569566 --- /dev/null +++ b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.hex @@ -0,0 +1,90 @@ +:100000000C9461000C947E000C947E000C947E0095 +:100010000C947E000C947E000C947E000C947E0068 +:100020000C947E000C947E000C947E000C947E0058 +:100030000C947E000C947E000C947E000C947E0048 +:100040000C94EC010C947E000C947E000C947E00C9 +:100050000C947E000C947E000C947E000C947E0028 +:100060000C947E000C947E00000000002400270009 +:100070002A0000000000250028002B0000000000DE +:1000800023002600290004040404040404040202DA +:100090000202020203030303030301020408102007 +:1000A0004080010204081020010204081020000012 +:1000B0000007000201000003040600000000000029 +:1000C000000011241FBECFEFD4E0DEBFCDBF11E092 +:1000D000A0E0B1E0E4E3F5E002C005900D92A434A5 +:1000E000B107D9F711E0A4E4B1E001C01D92A13538 +:1000F000B107E1F70E94D0000C9498020C94000024 +:10010000E0914401F0914501EE0FFF1FEC5FFE4FBF +:1001100060817181809100010E94930187E00E94BB +:100120004401909347018093460164E670E080E0CB +:1001300090E00E9434028091460190914701892B02 +:1001400071F080914401909145012091020130911C +:100150000301820F931F90934501809344012091E6 +:100160004401309145012F31310534F08FEF9FEF7D +:1001700090930301809302011216130634F081E07C +:1001800090E0909303018093020108958091000113 +:1001900061E00E94D70087E060E00E94D7000895E8 +:1001A0000E945E020E94C6000E948000FDCF282FA0 +:1001B00030E0C90186569F4FFC0194912A573F4F6A +:1001C000F9018491882391F0E82FF0E0EE0FFF1FF2 +:1001D000E859FF4FA591B491662329F48C9190952D +:1001E00089238C9308958C91892B8C930895482FA3 +:1001F00050E0CA0182559F4FFC012491CA018656E6 +:100200009F4FFC0194914A575F4FFA013491332379 +:10021000D1F1222331F1233021F4809180008F77B6 +:1002200005C0243031F4809180008F7D8093800060 +:1002300018C0213019F484B58F7704C0223021F41E +:1002400084B58F7D84BD0DC0263021F48091B0002F +:100250008F7705C0273029F48091B0008F7D80937F +:10026000B000E32FF0E0EE0FFF1FEE58FF4FA59117 +:10027000B491662329F48C91909589238C930895E9 +:100280008C91892B8C930895682F70E0CB01825557 +:100290009F4FFC012491CB0186569F4FFC01449156 +:1002A0006A577F4FFB019491992319F420E030E0C5 +:1002B00038C0222331F1233021F4809180008F77E0 +:1002C00005C0243031F4809180008F7D80938000C0 +:1002D00018C0213019F484B58F7704C0223021F47E +:1002E00084B58F7D84BD0DC0263021F48091B0008F +:1002F0008F7705C0273029F48091B0008F7D8093DF +:10030000B000892F90E0880F991F84589F4FFC01FF +:10031000A591B4918C9120E030E0842311F021E08C +:1003200030E0C90108951F93CF93DF93182FEB019D +:1003300061E00E94D700E12FF0E0E255FF4F849189 +:10034000833051F480918000806880938000D09346 +:100350008900C09388003CC0843051F480918000B3 +:10036000806280938000D0938B00C0938A0030C05D +:10037000813039F4209729F184B5806884BDC7BDE8 +:1003800027C0823039F42097E1F084B5806284BDC3 +:10039000C8BD1EC0863041F48091B0008068809353 +:1003A000B000C093B30014C0873041F48091B00016 +:1003B00080628093B000C093B4000AC0C038D105F9 +:1003C0001CF4812F60E002C0812F61E00E94F700E1 +:1003D000DF91CF911F9108951F920F920FB60F9248 +:1003E00011242F933F938F939F93AF93BF9380914B +:1003F0004C0190914D01A0914E01B0914F0130916F +:1004000050010196A11DB11D232F2D5F2D3720F026 +:100410002D570196A11DB11D2093500180934C01D1 +:1004200090934D01A0934E01B0934F0180914801EC +:1004300090914901A0914A01B0914B010196A11DF3 +:10044000B11D8093480190934901A0934A01B09354 +:100450004B01BF91AF919F918F913F912F910F9041 +:100460000FBE0F901F901895EF92FF920F931F935E +:100470007B018C018FB7F89440914C0150914D0154 +:1004800060914E0170914F018FBF2FB7F89480910A +:100490004C0190914D01A0914E01B0914F012FBFA1 +:1004A000841B950BA60BB70BE816F9060A071B076A +:1004B00060F71F910F91FF90EF900895789484B5A5 +:1004C000826084BD84B5816084BD85B5826085BD50 +:1004D00085B5816085BDEEE6F0E080818160808336 +:1004E000E1E8F0E0808182608083808181608083A8 +:1004F000E0E8F0E0808181608083E1EBF0E08081E2 +:1005000084608083E0EBF0E0808181608083EAE7B3 +:10051000F0E080818460808380818260808380813C +:10052000816080838081806880831092C1000895FB +:04053000F894FFCF6D +:100534000B000100000001000200020002000300A1 +:100544000300040005000600070008000A000B0071 +:100554000D001000130017001B00200026002D00C2 +:10056400360040004C005B006C0080009800B50031 +:04057400D700FF00AD +:00000001FF diff --git a/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.o b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.o new file mode 100644 index 0000000..0bafb06 Binary files /dev/null and b/arduino/sketch_sep15b/applet/sketch_sep15b.cpp.o differ diff --git a/arduino/sketch_sep15b/applet/wiring.c.o b/arduino/sketch_sep15b/applet/wiring.c.o new file mode 100644 index 0000000..450a0e1 Binary files /dev/null and b/arduino/sketch_sep15b/applet/wiring.c.o differ diff --git a/arduino/sketch_sep15b/applet/wiring_analog.c.o b/arduino/sketch_sep15b/applet/wiring_analog.c.o new file mode 100644 index 0000000..fbc3d62 Binary files /dev/null and b/arduino/sketch_sep15b/applet/wiring_analog.c.o differ diff --git a/arduino/sketch_sep15b/applet/wiring_digital.c.o b/arduino/sketch_sep15b/applet/wiring_digital.c.o new file mode 100644 index 0000000..1f02e56 Binary files /dev/null and b/arduino/sketch_sep15b/applet/wiring_digital.c.o differ diff --git a/arduino/sketch_sep15b/applet/wiring_pulse.c.o b/arduino/sketch_sep15b/applet/wiring_pulse.c.o new file mode 100644 index 0000000..58b5465 Binary files /dev/null and b/arduino/sketch_sep15b/applet/wiring_pulse.c.o differ diff --git a/arduino/sketch_sep15b/applet/wiring_shift.c.o b/arduino/sketch_sep15b/applet/wiring_shift.c.o new file mode 100644 index 0000000..9c3045a Binary files /dev/null and b/arduino/sketch_sep15b/applet/wiring_shift.c.o differ diff --git a/arduino/sketch_sep15b/sketch_sep15b.pde b/arduino/sketch_sep15b/sketch_sep15b.pde new file mode 100644 index 0000000..b21a540 --- /dev/null +++ b/arduino/sketch_sep15b/sketch_sep15b.pde @@ -0,0 +1,26 @@ +int ledPin = 11; +int foo = 0; +int dir = 1; + +int loga[32] = {0, 1, 2, 2, 2, 3, 3, 4, 5, 6, 7, 8, 10, 11, + 13, 16, 19, 23, 27, 32, 38, 45, 54, 64, 76, + 91, 108, 128, 152, 181, 215, 255}; + + +void setup() { + pinMode(ledPin, OUTPUT); +} + +void loop() { + analogWrite(ledPin, loga[foo]); + delay(100); + + foo += dir; + if (foo >= 31) { + dir = -1; + } + + if (foo <= 0) { + dir = +1; + } +} diff --git a/arduino/sketch_sep29a/applet/HardwareSerial.cpp.o b/arduino/sketch_sep29a/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..690d98e Binary files /dev/null and b/arduino/sketch_sep29a/applet/HardwareSerial.cpp.o differ diff --git a/arduino/sketch_sep29a/applet/Print.cpp.o b/arduino/sketch_sep29a/applet/Print.cpp.o new file mode 100644 index 0000000..624fc06 Binary files /dev/null and b/arduino/sketch_sep29a/applet/Print.cpp.o differ diff --git a/arduino/sketch_sep29a/applet/WInterrupts.c.o b/arduino/sketch_sep29a/applet/WInterrupts.c.o new file mode 100644 index 0000000..10fbd46 Binary files /dev/null and b/arduino/sketch_sep29a/applet/WInterrupts.c.o differ diff --git a/arduino/sketch_sep29a/applet/WMath.cpp.o b/arduino/sketch_sep29a/applet/WMath.cpp.o new file mode 100644 index 0000000..c2fe7dd Binary files /dev/null and b/arduino/sketch_sep29a/applet/WMath.cpp.o differ diff --git a/arduino/sketch_sep29a/applet/core.a b/arduino/sketch_sep29a/applet/core.a new file mode 100644 index 0000000..8d2a759 Binary files /dev/null and b/arduino/sketch_sep29a/applet/core.a differ diff --git a/arduino/sketch_sep29a/applet/pins_arduino.c.o b/arduino/sketch_sep29a/applet/pins_arduino.c.o new file mode 100644 index 0000000..f851e85 Binary files /dev/null and b/arduino/sketch_sep29a/applet/pins_arduino.c.o differ diff --git a/arduino/sketch_sep29a/applet/sketch_sep29a.cpp b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp new file mode 100644 index 0000000..da015cb --- /dev/null +++ b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp @@ -0,0 +1,60 @@ +#include "WProgram.h" +void setup(); +void loop(); +int pinA = 11; +int pinB = 12; +int pinLED = 13; +int pinLEDstate = LOW; +long prevMillis = 0; + +void setup() { + Serial.begin(9600); + pinMode(pinA, INPUT); + digitalWrite(pinA, HIGH); + pinMode(pinB, INPUT); + digitalWrite(pinB, HIGH); + pinMode(pinLED, OUTPUT); +} + +int a_old, b_old, dreh; + + + +void loop() { + // shall we blink +// if (millis() - prevMillis > 100) { +// prevMillis = millis(); +// +// if (pinLEDstate == LOW) +// pinLEDstate = HIGH; +// else +// pinLEDstate = LOW; +// digitalWrite(pinLED, pinLEDstate); +// + int a = digitalRead(pinA); + int b = digitalRead(pinB); + + if (a != a_old || b != b_old) { + Serial.print(digitalRead(pinA)); + Serial.print(" "); + Serial.print(digitalRead(pinB)); + Serial.println(); + dreh++; + // Serial.println("C:> _"); + } + digitalWrite(pinLED, a); + a_old = a; b_old = b; +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.eep b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.elf b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.elf new file mode 100755 index 0000000..60d93f3 Binary files /dev/null and b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.elf differ diff --git a/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.hex b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.hex new file mode 100644 index 0000000..01ab543 --- /dev/null +++ b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.hex @@ -0,0 +1,178 @@ +:100000000C9462000C948A000C948A000C948A0070 +:100010000C948A000C948A000C948A000C948A0038 +:100020000C948A000C948A000C948A000C948A0028 +:100030000C948A000C948A000C948A000C948A0018 +:100040000C94C4010C948A000C9446020C948A000F +:100050000C948A000C948A000C948A000C948A00F8 +:100060000C948A000C948A000000000024002700F1 +:100070002A0000000000250028002B0000000000DE +:1000800023002600290004040404040404040202DA +:100090000202020203030303030301020408102007 +:1000A0004080010204081020010204081020000012 +:1000B0000007000201000003040600000000000029 +:1000C00000008F0311241FBECFEFD4E0DEBFCDBFF1 +:1000D00011E0A0E0B1E0E2EEFAE002C005900D927E +:1000E000A231B107D9F711E0A2E1B1E001C01D9240 +:1000F000A83BB107E1F710E0C4ECD0E004C02297C0 +:10010000FE010E946B05C23CD107C9F70E940101A4 +:100110000C946F050C9400000F931F93CF93DF9303 +:10012000809102010E947501EC01809104010E94FE +:1001300075018C018091120190911301C817D907A4 +:1001400039F480911401909115010817190729F1CC +:10015000809102010E947501BC0185EA91E00E9434 +:10016000DE0485EA91E060E071E00E940004809185 +:1001700004010E947501BC0185EA91E00E94DE0441 +:1001800085EA91E00E940804809116019091170180 +:1001900001969093170180931601809106016C2FB0 +:1001A0000E942801D0931301C093120110931501EE +:1001B00000931401DF91CF911F910F91089585EA6B +:1001C00091E040E855E260E070E00E948302809197 +:1001D000020160E00E9408018091020161E00E943A +:1001E00028018091040160E00E94080180910401CF +:1001F00061E00E9428018091060161E00E940801EF +:1002000008950E940C020E94DF000E948C00FDCF26 +:10021000282F30E0C90186569F4FFC0194912A5740 +:100220003F4FF9018491882391F0E82FF0E0EE0F21 +:10023000FF1FE859FF4FA591B491662329F48C91D3 +:10024000909589238C9308958C91892B8C93089594 +:10025000482F50E0CA0182559F4FFC012491CA01EA +:1002600086569F4FFC0194914A575F4FFA01349193 +:100270003323D1F1222331F1233021F48091800006 +:100280008F7705C0243031F4809180008F7D80937A +:10029000800018C0213019F484B58F7704C0223053 +:1002A00021F484B58F7D84BD0DC0263021F480916A +:1002B000B0008F7705C0273029F48091B0008F7D82 +:1002C0008093B000E32FF0E0EE0FFF1FEE58FF4FDA +:1002D000A591B491662329F48C91909589238C93F0 +:1002E00008958C91892B8C930895682F70E0CB0131 +:1002F00082559F4FFC012491CB0186569F4FFC01F4 +:1003000044916A577F4FFB019491992319F420E09F +:1003100030E038C0222331F1233021F48091800075 +:100320008F7705C0243031F4809180008F7D8093D9 +:10033000800018C0213019F484B58F7704C02230B2 +:1003400021F484B58F7D84BD0DC0263021F48091C9 +:10035000B0008F7705C0273029F48091B0008F7DE1 +:100360008093B000892F90E0880F991F84589F4F89 +:10037000FC01A591B4918C9120E030E0842311F030 +:1003800021E030E0C90108951F920F920FB60F923D +:1003900011242F933F938F939F93AF93BF9380919B +:1003A0001C0190911D01A0911E01B0911F0130917F +:1003B00020010196A11DB11D232F2D5F2D3720F0A7 +:1003C0002D570196A11DB11D2093200180931C0182 +:1003D00090931D01A0931E01B0931F0180911801FD +:1003E00090911901A0911A01B0911B010196A11DD4 +:1003F000B11D8093180190931901A0931A01B09335 +:100400001B01BF91AF919F918F913F912F910F90C1 +:100410000FBE0F901F901895789484B5826084BDAC +:1004200084B5816084BD85B5826085BD85B58160F8 +:1004300085BDEEE6F0E0808181608083E1E8F0E058 +:10044000808182608083808181608083E0E8F0E049 +:10045000808181608083E1EBF0E080818460808333 +:10046000E0EBF0E0808181608083EAE7F0E080816A +:1004700084608083808182608083808181608083CA +:100480008081806880831092C10008951F920F922E +:100490000FB60F9211242F933F934F935F936F9357 +:1004A0007F938F939F93AF93BF93EF93FF9340916D +:1004B000C600E091A101F091A201CF01019660E890 +:1004C00070E00E9405059C018091A3019091A40118 +:1004D0002817390739F0EF5DFE4F40833093A201B2 +:1004E0002093A101FF91EF91BF91AF919F918F91C7 +:1004F0007F916F915F914F913F912F910F900FBE20 +:100500000F901F9018955F926F927F928F929F929B +:10051000AF92BF92CF92DF92EF92FF920F931F9311 +:10052000CF93DF93EC013A014B01413482E4580749 +:100530008FE0680780E078070CF07FC060E874E81F +:100540008EE190E0A40193010E943A0521503040D1 +:1005500040405040CA01B90122E030E040E050E0A4 +:100560000E943A0559016A01A6019501209530952E +:100570004095509594E0220F331F441F551F9A95C4 +:10058000D1F760E074E284EF90E00E943A05CA017E +:10059000B9012FEF30E040E050E00E94E604A401F2 +:1005A00093010E943A05C90181509F4F1816190600 +:1005B0001CF4522E5A9403C055245394521A60E0EE +:1005C00079E08DE390E0A40193010E943A05215067 +:1005D000304040405040CA01B90122E030E040E0E4 +:1005E00050E00E943A05209530954095509583E063 +:1005F000220F331F441F551F8A95D1F760E074E224 +:1006000084EF90E00E943A05CA01B9012FEF30E073 +:1006100040E050E00E94E604A40193010E943A05E4 +:10062000C90181509F4F181619061CF4822F815062 +:1006300002C081E0821B851500F5E885F98581E01F +:1006400090E00A8802C0880F991F0A94E2F780831D +:1006500060E079E08DE390E0A40193010E943A0507 +:100660002150304040405040CA01B90122E030E002 +:1006700040E050E00E943A0504C0E885F985108208 +:100680009501EC81FD813083EE81FF812083EA8535 +:10069000FB85208141E050E0CA010E8402C0880F32 +:1006A000991F0A94E2F7282B2083EA85FB85208195 +:1006B000CA010F8402C0880F991F0A94E2F7282B01 +:1006C0002083EA85FB858081088802C0440F551F7E +:1006D0000A94E2F7842B8083DF91CF911F910F91D1 +:1006E000FF90EF90DF90CF90BF90AF909F908F9052 +:1006F0007F906F905F900895FC01A085B18521895E +:100700008C9190E0022E02C0959587950A94E2F7AD +:1007100080FFF6CF0484F585E02D608308958CE09A +:1007200091E09093A6018093A50181E291E09093DE +:10073000A8018093A70185EC90E09093AA01809393 +:10074000A90184EC90E09093AC018093AB0180EC24 +:1007500090E09093AE018093AD0181EC90E0909396 +:10076000B0018093AF0186EC90E09093B20180934A +:10077000B10184E08093B30183E08093B40187E00A +:100780008093B50185E08093B60181E08093B70145 +:1007900008950F931F93CF93DF938C01EB0109C052 +:1007A0002196D801ED91FC910190F081E02DC801D6 +:1007B000099568816623A1F7DF91CF911F910F9171 +:1007C0000895EF92FF920F931F93CF93DF938C01C5 +:1007D0007B01EA010CC0D7016D917D01D801ED913B +:1007E000FC910190F081E02DC80109952197209797 +:1007F00091F7DF91CF911F910F91FF90EF900895A6 +:10080000DC01ED91FC910280F381E02D09950895C2 +:100810000F931F938C01DC01ED91FC910190F0810D +:10082000E02D6DE00995D801ED91FC910190F081EA +:10083000E02DC8016AE009951F910F9108952F924C +:100840003F924F925F926F927F928F929F92AF9260 +:10085000BF92CF92DF92EF92FF920F931F93DF939D +:10086000CF93CDB7DEB7A0970FB6F894DEBF0FBE1B +:10087000CDBF1C016A017B01411551056105710560 +:1008800049F4DC01ED91FC910190F081E02D60E3F1 +:10089000099554C0882499245401422E5524662475 +:1008A000772401E010E00C0F1D1F080D191DC70172 +:1008B000B601A30192010E941805F8016083089413 +:1008C000811C911CA11CB11CC701B601A30192019E +:1008D0000E941805C901DA016C017D01C114D1041F +:1008E000E104F104F1F681E0E82EF12CEC0EFD1E9E +:1008F000E80CF91C3E010894611C711CD501C4016F +:100900000197A109B1096C01C818D90814C0F601F2 +:10091000EE0DFF1D60816A3010F4605D01C0695CFE +:10092000D101ED91FC910190F081E02DC10109957B +:100930000894E108F1086E147F0449F7A0960FB6F9 +:10094000F894DEBF0FBECDBFCF91DF911F910F9105 +:10095000FF90EF90DF90CF90BF90AF909F908F90DF +:100960007F906F905F904F903F902F900895EF92FF +:10097000FF920F931F93CF93DF93EC017A018B01CA +:1009800077FF0FC0E881F9810190F081E02D6DE2E1 +:10099000099510950095F094E094E11CF11C011D5F +:1009A000111DCE01B801A7012AE00E941F04DF91AA +:1009B000CF911F910F91FF90EF900895AB016627A3 +:1009C00057FD6095762F0E94B7040895629FD0016D +:1009D000739FF001829FE00DF11D649FE00DF11DFA +:1009E000929FF00D839FF00D749FF00D659FF00DA9 +:1009F0009927729FB00DE11DF91F639FB00DE11D96 +:100A0000F91FBD01CF011124089597FB092E072678 +:100A10000AD077FD04D049D006D000201AF4709592 +:100A200061957F4F0895F6F7909581959F4F0895B2 +:100A3000A1E21A2EAA1BBB1BFD010DC0AA1FBB1FE2 +:100A4000EE1FFF1FA217B307E407F50720F0A21B54 +:100A5000B30BE40BF50B661F771F881F991F1A94C1 +:100A600069F760957095809590959B01AC01BD01EB +:100A7000CF01089597FB092E05260ED057FD04D00F +:100A8000D7DF0AD0001C38F4509540953095219559 +:100A90003F4F4F4F5F4F0895F6F7909580957095B3 +:100AA00061957F4F8F4F9F4F0895AA1BBB1B51E14C +:100AB00007C0AA1FBB1FA617B70710F0A61BB70BCE +:100AC000881F991F5A95A9F780959095BC01CD0173 +:100AD0000895EE0FFF1F0590F491E02D0994F8940E +:020AE000FFCF46 +:100AE20020000B000C000D00000000007C03C90375 +:020AF200E1031E +:00000001FF diff --git a/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.o b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.o new file mode 100644 index 0000000..6f53f62 Binary files /dev/null and b/arduino/sketch_sep29a/applet/sketch_sep29a.cpp.o differ diff --git a/arduino/sketch_sep29a/applet/wiring.c.o b/arduino/sketch_sep29a/applet/wiring.c.o new file mode 100644 index 0000000..450a0e1 Binary files /dev/null and b/arduino/sketch_sep29a/applet/wiring.c.o differ diff --git a/arduino/sketch_sep29a/applet/wiring_analog.c.o b/arduino/sketch_sep29a/applet/wiring_analog.c.o new file mode 100644 index 0000000..fbc3d62 Binary files /dev/null and b/arduino/sketch_sep29a/applet/wiring_analog.c.o differ diff --git a/arduino/sketch_sep29a/applet/wiring_digital.c.o b/arduino/sketch_sep29a/applet/wiring_digital.c.o new file mode 100644 index 0000000..1f02e56 Binary files /dev/null and b/arduino/sketch_sep29a/applet/wiring_digital.c.o differ diff --git a/arduino/sketch_sep29a/applet/wiring_pulse.c.o b/arduino/sketch_sep29a/applet/wiring_pulse.c.o new file mode 100644 index 0000000..58b5465 Binary files /dev/null and b/arduino/sketch_sep29a/applet/wiring_pulse.c.o differ diff --git a/arduino/sketch_sep29a/applet/wiring_shift.c.o b/arduino/sketch_sep29a/applet/wiring_shift.c.o new file mode 100644 index 0000000..9c3045a Binary files /dev/null and b/arduino/sketch_sep29a/applet/wiring_shift.c.o differ diff --git a/arduino/sketch_sep29a/sketch_sep29a.pde b/arduino/sketch_sep29a/sketch_sep29a.pde new file mode 100644 index 0000000..7100c52 --- /dev/null +++ b/arduino/sketch_sep29a/sketch_sep29a.pde @@ -0,0 +1,49 @@ +int pinA = 7; +int pinB = 8; +int pinLED = 13; +int pinLEDstate = LOW; +long prevMillis = 0; + +void setup() { + Serial.begin(9600); + pinMode(pinA, INPUT); + digitalWrite(pinA, HIGH); + pinMode(pinB, INPUT); + digitalWrite(pinB, HIGH); + pinMode(pinLED, OUTPUT); +} + +int a_old, b_old, dreh; + + + +void loop() { + // shall we blink +// if (millis() - prevMillis > 100) { +// prevMillis = millis(); +// +// if (pinLEDstate == LOW) +// pinLEDstate = HIGH; +// else +// pinLEDstate = LOW; +// digitalWrite(pinLED, pinLEDstate); +// + int a = digitalRead(pinA); + int b = digitalRead(pinB); + + if (a != a_old || b != b_old) { + Serial.print(digitalRead(pinA)); + Serial.print(" "); + Serial.print(digitalRead(pinB)); + Serial.println(); + dreh++; + // Serial.println("C:> _"); + } else { + if (dreh%2 == 0) { + Serial.println(); + } + } + + digitalWrite(pinLED, a); + a_old = a; b_old = b; +} diff --git a/eagle/SparkFun.lbr b/eagle/SparkFun.lbr new file mode 100644 index 0000000..bb854e2 Binary files /dev/null and b/eagle/SparkFun.lbr differ diff --git a/eagle/kackproject/DAC.b#1 b/eagle/kackproject/DAC.b#1 new file mode 100644 index 0000000..c1b156f Binary files /dev/null and b/eagle/kackproject/DAC.b#1 differ diff --git a/eagle/kackproject/DAC.b#2 b/eagle/kackproject/DAC.b#2 new file mode 100644 index 0000000..44ba73e Binary files /dev/null and b/eagle/kackproject/DAC.b#2 differ diff --git a/eagle/kackproject/DAC.b#3 b/eagle/kackproject/DAC.b#3 new file mode 100644 index 0000000..18526ac Binary files /dev/null and b/eagle/kackproject/DAC.b#3 differ diff --git a/eagle/kackproject/DAC.b#4 b/eagle/kackproject/DAC.b#4 new file mode 100644 index 0000000..dd75812 Binary files /dev/null and b/eagle/kackproject/DAC.b#4 differ diff --git a/eagle/kackproject/DAC.b#5 b/eagle/kackproject/DAC.b#5 new file mode 100644 index 0000000..1d9c159 Binary files /dev/null and b/eagle/kackproject/DAC.b#5 differ diff --git a/eagle/kackproject/DAC.b#6 b/eagle/kackproject/DAC.b#6 new file mode 100644 index 0000000..86824af Binary files /dev/null and b/eagle/kackproject/DAC.b#6 differ diff --git a/eagle/kackproject/DAC.b#7 b/eagle/kackproject/DAC.b#7 new file mode 100644 index 0000000..1b829bc Binary files /dev/null and b/eagle/kackproject/DAC.b#7 differ diff --git a/eagle/kackproject/DAC.b#8 b/eagle/kackproject/DAC.b#8 new file mode 100644 index 0000000..72cace5 Binary files /dev/null and b/eagle/kackproject/DAC.b#8 differ diff --git a/eagle/kackproject/DAC.b#9 b/eagle/kackproject/DAC.b#9 new file mode 100644 index 0000000..900af46 Binary files /dev/null and b/eagle/kackproject/DAC.b#9 differ diff --git a/eagle/kackproject/DAC.brd b/eagle/kackproject/DAC.brd new file mode 100644 index 0000000..cab7e68 Binary files /dev/null and b/eagle/kackproject/DAC.brd differ diff --git a/eagle/kackproject/DAC.pro b/eagle/kackproject/DAC.pro new file mode 100644 index 0000000..b3ce5e2 --- /dev/null +++ b/eagle/kackproject/DAC.pro @@ -0,0 +1,25 @@ +EAGLE AutoRouter Statistics: + +Job : /home/entropia/Desktop/arduinisten/eagle/kackproject/DAC.brd + +Start at : 20:03:32 (1/26/10) +End at : 20:03:33 (1/26/10) +Elapsed time : 00:00:01 + +Signals : 13 RoutingGrid: 100 mil Layers: 2 +Connections : 16 predefined: 14 ( 0 Vias ) + +Router memory : 7332 + +Passname : Route Optimize1 Optimize2 Optimize3 Optimize4 + +Time per pass : 00:00:01 00:00:00 00:00:00 00:00:00 00:00:00 +Number of Ripups : 0 0 0 0 0 +max. Level : 0 0 0 0 0 +max. Total : 0 0 0 0 0 + +Routed : 1 1 1 1 1 +Vias : 2 0 0 0 0 +Resolution : 93.8 % 93.8 % 93.8 % 93.8 % 93.8 % + +Final : 93.8% finished diff --git a/eagle/kackproject/DAC.s#1 b/eagle/kackproject/DAC.s#1 new file mode 100644 index 0000000..c297ad3 Binary files /dev/null and b/eagle/kackproject/DAC.s#1 differ diff --git a/eagle/kackproject/DAC.s#2 b/eagle/kackproject/DAC.s#2 new file mode 100644 index 0000000..4011d6b Binary files /dev/null and b/eagle/kackproject/DAC.s#2 differ diff --git a/eagle/kackproject/DAC.s#3 b/eagle/kackproject/DAC.s#3 new file mode 100644 index 0000000..f8c58a7 Binary files /dev/null and b/eagle/kackproject/DAC.s#3 differ diff --git a/eagle/kackproject/DAC.s#4 b/eagle/kackproject/DAC.s#4 new file mode 100644 index 0000000..4fe7a24 Binary files /dev/null and b/eagle/kackproject/DAC.s#4 differ diff --git a/eagle/kackproject/DAC.s#5 b/eagle/kackproject/DAC.s#5 new file mode 100644 index 0000000..0367019 Binary files /dev/null and b/eagle/kackproject/DAC.s#5 differ diff --git a/eagle/kackproject/DAC.s#6 b/eagle/kackproject/DAC.s#6 new file mode 100644 index 0000000..8696058 Binary files /dev/null and b/eagle/kackproject/DAC.s#6 differ diff --git a/eagle/kackproject/DAC.s#7 b/eagle/kackproject/DAC.s#7 new file mode 100644 index 0000000..6ce3388 Binary files /dev/null and b/eagle/kackproject/DAC.s#7 differ diff --git a/eagle/kackproject/DAC.s#8 b/eagle/kackproject/DAC.s#8 new file mode 100644 index 0000000..1ee1e10 Binary files /dev/null and b/eagle/kackproject/DAC.s#8 differ diff --git a/eagle/kackproject/DAC.s#9 b/eagle/kackproject/DAC.s#9 new file mode 100644 index 0000000..cfad785 Binary files /dev/null and b/eagle/kackproject/DAC.s#9 differ diff --git a/eagle/kackproject/DAC.sch b/eagle/kackproject/DAC.sch new file mode 100644 index 0000000..5444438 Binary files /dev/null and b/eagle/kackproject/DAC.sch differ diff --git a/eagle/kackproject/eagle.epf b/eagle/kackproject/eagle.epf new file mode 100644 index 0000000..a1e9022 --- /dev/null +++ b/eagle/kackproject/eagle.epf @@ -0,0 +1,63 @@ +[Eagle] +Version="05 07 00" +Platform="Linux" +Serial="62191E841E-LSR-WLM-1EL" +Globals="Globals" +Desktop="Desktop" + +[Globals] +AutoSaveProject=1 +UsedLibrary="/home/entropia/Desktop/arduinisten/eagle-5.7.0/lbr/con-amp.lbr" +UsedLibrary="/home/entropia/Desktop/arduinisten/eagle-5.7.0/lbr/supply1.lbr" +UsedLibrary="/home/entropia/Desktop/arduinisten/eagle/SparkFun.lbr" +UsedLibrary="/home/entropia/Desktop/arduinisten/eagle/tda8702.lbr" + +[Win_1] +Type="Board Editor" +Loc="0 0 599 399" +State=0 +Number=2 +File="DAC.brd" +View="-20003 -16000 1020195 816000" +WireWidths=" 0 2540 3048 6096 8128 10160 12700 14224 16764 17780 19304 21844 25400 38100 64516 4064" +PadDiameters=" 2540 3048 4064 6096 8128 10160 12700 14224 16764 17780 19304 21844 25400 38100 64516 0" +PadDrills=" 5000 6000 7000 9000 10000 11000 12000 13000 14000 15000 16000 20000 22000 28000 32000 8000" +ViaDiameters=" 2540 3048 4064 6096 8128 10160 12700 14224 16764 17780 19304 21844 25400 38100 64516 0" +ViaDrills=" 5000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 20000 22000 28000 32000 6000" +HoleDrills=" 5000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 20000 22000 28000 32000 6000" +TextSizes=" 2540 3048 4064 6096 8128 10160 12700 14224 16764 19304 21844 25400 38100 50800 64516 17780" +PolygonSpacings=" 2540 3048 4064 6096 8128 10160 14224 16764 17780 19304 21844 25400 38100 50800 64516 12700" +PolygonIsolates=" 2540 3048 4064 6096 8128 10160 12700 14224 16764 17780 19304 21844 25400 38100 64516 0" +MiterRadiuss=" 2540 3175 6350 12700 25400 10000 20000 25000 50000 75000 100000 0" +SmdSizes=" 3048 1524 4064 2032 6096 3048 8128 4064 10160 5080 12700 6604 14224 7112 16764 8128 17780 9144 19304 9652 21844 10668 25400 12700 38100 19304 50800 25400 64516 32512 12700 6350" +WireBend=0 +WireBendSet=0 +WireCap=1 +MiterStyle=0 +PadShape=0 +ViaShape=0 +PolygonPour=0 +PolygonRank=1 +PolygonThermals=1 +PolygonOrphans=0 +TextRatio=8 +PinDirection=3 +PinFunction=0 +PinLength=2 +PinVisible=3 +SwapLevel=0 +ArcDirection=0 +AddLevel=2 +PadsSameType=0 +Layer=16 + +[Win_2] +Type="Control Panel" +Loc="1659 744 2184 1150" +State=2 +Number=0 + +[Desktop] +Screen="3200 1200" +Window="Win_1" +Window="Win_2" diff --git a/eagle/tda8702.l#1 b/eagle/tda8702.l#1 new file mode 100644 index 0000000..26d1643 Binary files /dev/null and b/eagle/tda8702.l#1 differ diff --git a/eagle/tda8702.l#2 b/eagle/tda8702.l#2 new file mode 100644 index 0000000..110e285 Binary files /dev/null and b/eagle/tda8702.l#2 differ diff --git a/eagle/tda8702.l#3 b/eagle/tda8702.l#3 new file mode 100644 index 0000000..c6e80f2 Binary files /dev/null and b/eagle/tda8702.l#3 differ diff --git a/eagle/tda8702.l#4 b/eagle/tda8702.l#4 new file mode 100644 index 0000000..5028498 Binary files /dev/null and b/eagle/tda8702.l#4 differ diff --git a/eagle/tda8702.l#5 b/eagle/tda8702.l#5 new file mode 100644 index 0000000..f0cb76b Binary files /dev/null and b/eagle/tda8702.l#5 differ diff --git a/eagle/tda8702.l#6 b/eagle/tda8702.l#6 new file mode 100644 index 0000000..c690d20 Binary files /dev/null and b/eagle/tda8702.l#6 differ diff --git a/eagle/tda8702.lbr b/eagle/tda8702.lbr new file mode 100644 index 0000000..e0d74cc Binary files /dev/null and b/eagle/tda8702.lbr differ diff --git a/projekte/druckerfoo/arduino_drucker_01.jpg b/projekte/druckerfoo/arduino_drucker_01.jpg new file mode 100644 index 0000000..db46ad1 Binary files /dev/null and b/projekte/druckerfoo/arduino_drucker_01.jpg differ diff --git a/projekte/druckerfoo/arduino_drucker_02.jpg b/projekte/druckerfoo/arduino_drucker_02.jpg new file mode 100644 index 0000000..b474bd2 Binary files /dev/null and b/projekte/druckerfoo/arduino_drucker_02.jpg differ diff --git a/projekte/druckerfoo/druckerfoo/druckerfoo.pde b/projekte/druckerfoo/druckerfoo/druckerfoo.pde new file mode 100644 index 0000000..26449cb --- /dev/null +++ b/projekte/druckerfoo/druckerfoo/druckerfoo.pde @@ -0,0 +1,234 @@ +#include + +/* +Arduino Desc DB-25 Pin +======= ==== ========= +GND GND 18-25 +13 BUSY 11 +12 nACK 10 +11 D7 9 +10 D6 8 + 9 D5 7 + 8 D4 6 + 7 D3 5 + 6 D2 4 + 5 D1 3 + 4 D0 2 + 3 nSTROBE 1 +*/ + +int PIN_nSTROBE = 3; +int PIN_nACK = 12; +int PIN_BUSY = 13; + +PROGMEM char porn[] = +"\r\n" +"\r\n" +" sexsexsexsexsexse\r\n" +" sexsesexsexsexsexsexs\r\n" +" sexsexsexsexsexsexsexse\r\n" +" sexsexsexsexsexsexsexsexsex\r\n" +" sexsexsexsexsexsexsexsexsexsex\r\n" +" sexsexsexsexsexsexsexsexsexsexs\r\n" +" sexsexsexsexsexsexsexsexsexsexsex\r\n" +" sexsexsexsexsexsexsexsexsexsexsexse\r\n" +" sexsexsexsexsexsexsexsexsexsexsexsex\r\n" +" exsexsexsexsexsexsexsex sexsexsexsex\r\n" +" sexsexsexsexsexsexsexs sexsexsexse\r\n" +" sexsexsexsexsexsexsex sexsexsex\r\n" +" sexsexsexsexsexsex sexsexsx\r\n" +" sexsexsexsexsexx sexsexs x\r\n" +" sexsexsexsexsex-****. .***-sexsexs sexs\r\n" +" sexsexsexsexsex sexsex sexsexs\r\n" +" sexsexsexsexsex sexsex sexsexsexs\r\n" +" sexsexsexsexsex sexse sexsexsexse\r\n" +" sesexsexsexsexs --sexsex- sexse sexsexsexse\r\n" +" xsexsexsexsexse sexs sexse sexsexsexs\r\n" +" sexsexsexsexsexse sexse sexsexsexse\r\n" +" sexsexsexsexsexsexs sexse sexsexse\r\n" +" sexsexse sexsexs ixx sexse\r\n" +" sexsex sexsexs i sex\r\n" +" sexs sexsexs i x\r\n" +" sex sexsex x x\r\n" +" x sexsex x x\r\n" +" x sexse xx\r\n" +" sex sex x\r\n" +" sexsexs xx x\r\n" +" sexsexsex x x x x\r\n" +" sexsexsexsexse x (o\r\n" +" sexsexsexsexse x x\r\n" +" sexsexsexsexse x x (o) x x\r\n" +" sexsexsexsexse x x x x\r\n" +" sexsexsexsex x x x x\r\n" +" sexsexsexsex x x x xx\r\n" +" sexsexsexse x x x x\r\n" +" sexsexsexse x x x x x\r\n" +" sexsexsexs x x\r\n" +" sexsexsexs x x\r\n" +" sexsexsex x x\r\n" +" sexsexsex x x\r\n" +" sexsexsex x x\r\n" +" sexsexse x x\r\n" +" sexsexse x x\r\n" +" sexsexs x x\r\n" +" sexsex sexsexse x x\r\n" +" sexsexsexsexsexs x\r\n" +" sexsexsexsexse x\r\n" +" sexsexsexsex o x\r\n" +" sexsex x\r\n" +" x x\r\n" +" x x\r\n" +" x x\r\n" +" x Y x\r\n" +" x x x\r\n" +" x x x\r\n" +" x x x\r\n" +" x sexsexsex x\r\n" +" x sexsexsexsexsx exsex\r\n" +" x sexsexsexsexsexs sexx\r\n" +" x sexsexsexsexsexsexs xx\r\n" +" x sexsexsexsexsexsexse x\r\n" +" x sexsexsexsexsexsexsexs\r\n" +" x sexsexsexsexsexsexsexse\r\n" +" sexsexsexsexsexsexsexsex\r\n" +" sexsexsexsexsexsexsexse\r\n" +" x sexsexsexsexsexsexsexs\r\n" +" xx sexsexsexsexsexsexsexs\r\n" +" sex sexsexsexsexsexsexsex\r\n" +" sex sexsexsexsexsexsexse\r\n" +" sexs sexsexsexsexsexsexs\r\n" +" sexse sexsexsexsexsexse\r\n" +" sexsex sexsexsexsexsexse\r\n" +" sexsex sexsexsexsexsexs\r\n" +" sexsexs sexsexsexsexsex\r\n" +" sexsexs sexsexsexsexse\r\n" +" sexsexse sexsexsexsexs\r\n" +" sexsexsex sexsexsexsex\r\n" +" sexsexsexs sexsexsexse\r\n" +" sexsexsexs sexsexsexse\r\n" +" sexsexsexse sexsexsexs\r\n" +" sexsexsexs sexsexsexse\r\n" +" sexsexsexse sexsexsexse\r\n" +" sexsexsexse sexsexsexse\r\n" +" sexsexsexse sexsexsexs\r\n" +" sexsexsexse sexsexsexse\r\n" +" sexsexsexsex sexsexsexse\r\n" +" sexsexsexsex sexsexsexse\r\n" +" sexsexsexsex sexsexsexsex\r\n" +" sexsexsexse sexsexsexsex\r\n" +" sexsexsexse sexsexsexsex\r\n" +" sexsexsexs sexsexsexsex\r\n" +" sexsexsexs sexsexsexse\r\n" +" sexsexsex sexsexsexse\r\n" +" sexsexse sexsexsexs\r\n" +" sexsexse sexsexsex\r\n" +" sexsexs sexsexse\r\n" +" sexsex sexsexs\r\n" +" sexsex sexsexs\r\n" +" sexsex sexsex\r\n" +" exsex sexse\r\n" +" sexsex sexsex\r\n" +" sexsex sexsex\r\n" +" sexsexs sexsexx\r\n" +" sexsexsex sexsexse\r\n" +" sexsexsexse sexsexsexse\r\n" +" sexsexsexsexs sexsexsexsex\r\n" +" sexsexsexsexse sexsexsexsex\r\n" +" sex sexsexsex sexsexsexsex\r\n" +" x sexsexse xx sexsexse\r\n" +" x sexsex\r\n" +" sexse\r\n" +" sexse\r\n" +" sexse\r\n" +" sex\r\n" +" xx\r\n" +" xx\r\n" +"\r\n" + +; + + +void setup() { + int i; + + for( i = 3; i <= 11; i++ ) { + pinMode (i, OUTPUT); + digitalWrite(i, LOW); + } + + digitalWrite(PIN_nSTROBE, HIGH); + pinMode (PIN_nACK, INPUT); + pinMode (PIN_BUSY, INPUT); + + // DEBUG + Serial.begin(9600); +} + +void lpString(char* string) { + /**************************** + http://www.beyondlogic.org/spp/parallel.htm + + Data is first applied on the Parallel Port pins 2 to 7. + The host then checks to see if the printer is busy. + i.e. the busy line should be low. The program then + asserts the strobe, waits a minimum of 1uS, and then + de-asserts the strobe. Data is normally read by the + printer/peripheral on the rising edge of the strobe. + he printer will indicate that it is busy processing data + via the Busy line. Once the printer has accepted data, + t will acknowledge the byte by a negative pulse about + uS on the nAck line. + ****************************/ + + int i = 0; + while(char c = string[i++]) { + // Spin on busy printer + while (digitalRead(PIN_BUSY) == HIGH){;} + + // assert character to data lines + for (uint8_t b=0; b<8; b++) { + digitalWrite(4+b, c & 1); + c = c >> 1; + } + + delayMicroseconds(50); // settle + + // assert strobe, + // then deassert strobe (commit data) + digitalWrite(PIN_nSTROBE, LOW); + delayMicroseconds(50); // settle + digitalWrite(PIN_nSTROBE, HIGH); + + // ignore BUSY, wait for falling nACK + while (digitalRead(PIN_nACK) == HIGH){;} + + // now wait for rising nACK + while (digitalRead(PIN_nACK) == LOW){;} + } +} + +void lpPorn(PGM_P string) { + int i = 0, j = 0; + char buf[80]; + + while (buf[j++] = pgm_read_byte(&string[i++])) { + + // print a line a few times + if (buf[j-1] == '\n') { + buf[j-1] = 0; // terminate string + for (int k=1; k<=5; k++) { + lpString(buf); + Serial.println(buf); + } + // + lpString("\n"); + + j = 0; // reset + } + } +} + + +void loop() { + lpPorn(porn); +} diff --git a/projekte/duinopong/drehimpulsgeber_doku.pdf b/projekte/duinopong/drehimpulsgeber_doku.pdf new file mode 100644 index 0000000..1314c84 Binary files /dev/null and b/projekte/duinopong/drehimpulsgeber_doku.pdf differ diff --git a/projekte/duinopong/duinopong.avi b/projekte/duinopong/duinopong.avi new file mode 100644 index 0000000..264f7c2 Binary files /dev/null and b/projekte/duinopong/duinopong.avi differ diff --git a/projekte/duinopong/duinopong.png b/projekte/duinopong/duinopong.png new file mode 100644 index 0000000..a7d18c4 Binary files /dev/null and b/projekte/duinopong/duinopong.png differ diff --git a/projekte/duinopong/duinopong/applet/HardwareSerial.cpp.o b/projekte/duinopong/duinopong/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..ff3e13c Binary files /dev/null and b/projekte/duinopong/duinopong/applet/HardwareSerial.cpp.o differ diff --git a/projekte/duinopong/duinopong/applet/LCD4Bit/LCD4Bit.cpp.o b/projekte/duinopong/duinopong/applet/LCD4Bit/LCD4Bit.cpp.o new file mode 100644 index 0000000..58ee2a3 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/LCD4Bit/LCD4Bit.cpp.o differ diff --git a/projekte/duinopong/duinopong/applet/Print.cpp.o b/projekte/duinopong/duinopong/applet/Print.cpp.o new file mode 100644 index 0000000..1820b34 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/Print.cpp.o differ diff --git a/projekte/duinopong/duinopong/applet/WInterrupts.c.o b/projekte/duinopong/duinopong/applet/WInterrupts.c.o new file mode 100644 index 0000000..a93ecc3 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/WInterrupts.c.o differ diff --git a/projekte/duinopong/duinopong/applet/WMath.cpp.o b/projekte/duinopong/duinopong/applet/WMath.cpp.o new file mode 100644 index 0000000..215570c Binary files /dev/null and b/projekte/duinopong/duinopong/applet/WMath.cpp.o differ diff --git a/projekte/duinopong/duinopong/applet/core.a b/projekte/duinopong/duinopong/applet/core.a new file mode 100644 index 0000000..9c03f05 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/core.a differ diff --git a/projekte/duinopong/duinopong/applet/duinopong.cpp b/projekte/duinopong/duinopong/applet/duinopong.cpp new file mode 100644 index 0000000..cc3a4be --- /dev/null +++ b/projekte/duinopong/duinopong/applet/duinopong.cpp @@ -0,0 +1,293 @@ +#include +#include +#include +#include + +#define DEBUG 0 + +#include "WProgram.h" +void awesome_scroller(); +void setup_game(); +void setup(); +void display_paddle (int paddle, int pos); +void move_ball (); +void display_ball (); +void game_over(); +void display_level(); +void level_up(); +void loop(); +LCD4Bit lcd = LCD4Bit(2); + +int pinA = 11; +int pinB = 12; +int ledPin = 13; + +volatile int8_t enc_value = 0; +volatile int8_t enc_value_old = 0; + +void awesome_scroller() { + // the logo + lcd.cursorTo(1,13); + lcd.printIn("ARDUINO POING"); + lcd.cursorTo(2,1); + lcd.printIn("shall i prewarm sir's rotary encoder?"); + + // awesum fx + delay(500); + lcd.cursorTo(2,39); + for (int i=0; i<80; i++) { + lcd.print(' '); + delay(100); + } +} + +#define SCALE 64 +#define COLS 20 +#define PADDLE2_POS (COLS-1) + +int ball_x, ball_y; +int ball_vel_x, ball_vel_y; +uint8_t level; + +void setup_game() { + lcd.clear(); + + // reinit stuff + ball_x = 2*SCALE; + ball_y = random(0,16); + ball_vel_x = 1.0 * SCALE; + ball_vel_y = 1.0 * SCALE; + + // + for (int i=PADDLE2_POS+2; i<=39; i++) { + lcd.cursorTo(2, i); + lcd.print(' '); + } + + // level + level = 1; + display_level(); + + // init paddles + enc_value = 0; + display_paddle(0,2); + display_paddle(1,2); +} + +void setup() { + //Timer2 Settings + TCCR2A = 0; + TCCR2B = 0< 14*ENC_STEPS) + enc_value = 14*ENC_STEPS; +} + + + +void display_paddle (int paddle, int pos) { + #define CHAR_PADDLE paddle + + assert(paddle == 0 || paddle == 1); + + // blank first + lcd.cursorTo(1,paddle*(COLS-1)); lcd.print(' '); + lcd.cursorTo(2,paddle*(COLS-1)); lcd.print(' '); + + // gen char + lcd.commandWrite(0x40+CHAR_PADDLE*8); // char 0b00 + for (uint8_t i = 0; i<8; i++) { + if(i == (pos & 0x7) || i-1 == (pos & 0x7) || i+1 == (pos & 0x7) ) { + if (paddle == 0) { + lcd.print(0b00011); + } else { + lcd.print(0b11000); + } + } else { + lcd.print(0b00000); + } + } + + // display shit + if (pos < 8) { + lcd.cursorTo(1,paddle*PADDLE2_POS); lcd.print(CHAR_PADDLE); + lcd.cursorTo(2,paddle*PADDLE2_POS); lcd.print(' '); + } else { + lcd.cursorTo(1,paddle*PADDLE2_POS); lcd.print(' '); + lcd.cursorTo(2,paddle*PADDLE2_POS); lcd.print(CHAR_PADDLE); + } +} + +#define BALL_X_MAX (COLS-2) +#define res_x BALL_X_MAX*5*SCALE +#define res_y 16*SCALE + +void move_ball () { + ball_x += ball_vel_x; + ball_y += ball_vel_y; + + if (ball_x >= res_x || ball_x < 0) { + ball_vel_x *= -1; + ball_x += ball_vel_x; + } + + if (ball_y >= res_y || ball_y < 0) { + ball_vel_y *= -1; + ball_y += ball_vel_y; + } +} + +int cursor_x_alt = 1; +int cursor_y_alt = 1; + +void display_ball () { + #define CHAR_BALL 2 + + int cursor_x = (ball_x/SCALE)/5+1; + int cursor_y = (ball_y/SCALE)/8+1; + + // first, delete old ball + if (cursor_x != cursor_x_alt || cursor_y != cursor_y_alt) { + lcd.cursorTo(cursor_y_alt, cursor_x_alt); + lcd.print(' '); + } + cursor_x_alt = cursor_x; + cursor_y_alt = cursor_y; + + // second, generate character for new ball + lcd.commandWrite(0x40+CHAR_BALL*8); + for (int i = 0; i<8; i++) { + if(i == ((ball_y/SCALE)&7)) { + lcd.print(1 << 4-(ball_x/SCALE)%5); + } else { + lcd.print(0b00000); + } + } + + // third, write new ball + lcd.cursorTo(cursor_y, cursor_x); + lcd.print(CHAR_BALL); +} + +void game_over() { + for (int8_t i=0; i<7; i++) { + lcd.cursorTo(2, PADDLE2_POS + 2); + lcd.printIn(" "); + delay(100); + + lcd.cursorTo(2, PADDLE2_POS + 2); + lcd.printIn("GAME OVER."); + delay(200); + } + delay(1000); + + while(enc_value == enc_value_old); + setup_game(); +} + +void display_level() { + lcd.cursorTo(1, PADDLE2_POS + 2); + lcd.printIn("LEVEL "); + + char level_str[4]; + itoa(level, level_str, 10); + lcd.printIn(level_str); +} + +void level_up() { + // pump it up + level++; + display_level(); + + // make ball faster + // 70 / 64 is about 1.1 + ball_vel_x = ball_vel_x * 70 / 64; +} + +int player2 = random(1,14); +void loop() { + // move player1's paddle + int val = enc_value; + enc_value_old = val; + display_paddle(0, val/ENC_STEPS); + + // teh ball! + move_ball(); + display_ball(); + + // incoming ball? WIN or FAIL. + if (ball_x/SCALE < 1 && ball_vel_x < 0) { + if (val/ENC_STEPS-1 != ball_y/SCALE + && val/ENC_STEPS != ball_y/SCALE + && val/ENC_STEPS+1 != ball_y/SCALE) { + game_over(); + } else { + level_up(); + } + } + + // fake computer player2 by moving its paddle in + // direction of the ball's vertical position + if (ball_vel_x > 0 && ball_x/SCALE > (BALL_X_MAX-4)*5) { + if (player2 < ball_y/SCALE && player2 < 14) + player2++; + if (player2 > ball_y/SCALE && player2 > 1) + player2--; + } + display_paddle(1, player2); +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/projekte/duinopong/duinopong/applet/duinopong.cpp.eep b/projekte/duinopong/duinopong/applet/duinopong.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/projekte/duinopong/duinopong/applet/duinopong.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/projekte/duinopong/duinopong/applet/duinopong.cpp.elf b/projekte/duinopong/duinopong/applet/duinopong.cpp.elf new file mode 100755 index 0000000..860e723 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/duinopong.cpp.elf differ diff --git a/projekte/duinopong/duinopong/applet/duinopong.cpp.hex b/projekte/duinopong/duinopong/applet/duinopong.cpp.hex new file mode 100644 index 0000000..f5c3ffc --- /dev/null +++ b/projekte/duinopong/duinopong/applet/duinopong.cpp.hex @@ -0,0 +1,346 @@ +:100000000C9463000C948B000C948B000C948B006C +:100010000C948B000C948B000C948B000C948B0034 +:100020000C948B000C9425040C948B000C948B0086 +:100030000C948B000C948B000C948B000C948B0014 +:100040000C947C060C948B000C9435070C948B005C +:100050000C948B000C948B000C948B000C948B00F4 +:100060000C948B000C948B000000000024002700EF +:100070002A0000000000250028002B0000000000DE +:1000800023002600290004040404040404040202DA +:100090000202020203030303030301020408102007 +:1000A0004080010204081020010204081020000012 +:1000B0000007000201000003040600000000000029 +:1000C00000007502770811241FBECFEFD4E0DEBF19 +:1000D000CDBF11E0A0E0B1E0E0E1F5E102C00590A4 +:1000E0000D92A837B107D9F712E0A8E7B1E001C037 +:1000F0001D92AA32B107E1F710E0C6ECD0E004C0CF +:100100002297FE010E94B409C23CD107C9F70E94A0 +:10011000BD050C94860A0C940000709364016093F2 +:100120006301615070406230710530F081E090E011 +:10013000909364018093630108958091590160E078 +:100140000E94E30581E090E00E94EE068091590153 +:1001500061E00E94E30581E090E00E94EE0680915C +:10016000590160E00E94E30561E070E080E090E00A +:100170000E94C4060895EF92FF920F931F93CF93AE +:10018000DF93EC018B010F701070E0905B01F09039 +:100190005C010AC0602F61708E2D0E94E3051595E9 +:1001A00007950894E11CF11C809161019091620116 +:1001B0008E159F057CF7CE010E949D00DF91CF91A7 +:1001C0001F910F91FF90EF9008950F931F93CF937E +:1001D000DF93EC018B0194E0759567959A95E1F7B3 +:1001E000CE010E94BB00B8016F707070CE010E94FA +:1001F000BB00DF91CF911F910F9108950F931F9333 +:10020000CF93DF938C01EB018091550160E00E9458 +:10021000E3058091780190917901009729F0809110 +:10022000570160E00E94E305C801BE010E94BB00C7 +:10023000DF91CF911F910F9108950F931F93CF934B +:10024000DF938C01EB018091550161E00E94E30591 +:100250008091780190917901009729F08091570160 +:1002600060E00E94E305C801BE010E94E500DF9145 +:10027000CF911F910F910895CF92DF92EF92FF924D +:100280001F93CF93DF937C01EB0110E00BC08C0F29 +:100290009D1FFC016081772767FD7095C7010E9453 +:1002A0001D011F5F812F90E06E01AC2FBD2DFD0160 +:1002B00001900020E9F73197EA1BFB0B8E179F078F +:1002C00030F3DF91CF911F91FF90EF90DF90CF90AF +:1002D00008950F931F93CF93DF938C01EB018091CF +:1002E000550160E00E94E3058091780190917901C9 +:1002F000009729F08091570160E00E94E305C80152 +:10030000BE010E94E500DF91CF911F910F910895EA +:100310009B0160916301709164016130710529F066 +:100320002230310511F4405C5F4FBA0160587F4FB5 +:100330000E9469010895CF93DF93EC0180915901E8 +:1003400061E00E94C4058091550161E00E94C405EE +:100350008091780190917901009729F0809157015F +:1003600061E00E94C40580915B0161E00E94C405C8 +:1003700080915D0161E00E94C40580915F0161E0B0 +:100380000E94C4058091610161E00E94C40562E39E +:1003900070E080E090E00E94C406CE0163E070E06F +:1003A0000E94FE0065E070E080E090E00E94C406DC +:1003B000CE0163E070E00E94FE0084E690E00E94BF +:1003C000EE06CE0163E070E00E94FE0065E070E0A2 +:1003D00080E090E00E94C406CE0162E070E00E94DE +:1003E000FE00CE0162E070E00E94FE0060916301B9 +:1003F000709164016150704023E0660F771F2A9569 +:10040000E1F7CE010E94FE008CE390E00E94EE0630 +:10041000CE016CE070E00E9469018CE390E00E94E4 +:10042000EE06CE0161E070E00E94690163E070E0D9 +:1004300080E090E00E94C406CE0166E070E00E9479 +:10044000690161E070E080E090E00E94C406DF9105 +:10045000CF91089561E070E00E94690161E070E071 +:1004600080E090E00E94C40608956091810170913F +:10047000820120917D0130917E01260F371F30933C +:100480007E0120937D0140918301509184018091F0 +:100490007F0190918001840F951F9093800180933C +:1004A0007F01E6E120383E0768F0709561957F4F47 +:1004B0007093820160938101260F371F30937E0174 +:1004C00020937D0124E08030920770F022273327AB +:1004D000241B350B3093840120938301820F931FDB +:1004E0009093800180937F0108958AE791E062E014 +:1004F00070E00E948D0061E070E080E090E02EE00E +:1005000030E040E050E00E94D7087093870160938C +:1005100086010895EF92FF920F931F93DF93CF937D +:1005200000D000D0CDB7DEB70AE711E0C80161E026 +:1005300070E045E150E00E948801C80160E071E090 +:100540000E943C018091850190E07E010894E11CAD +:10055000F11CB7014AE050E00E941E0AC801B70131 +:100560000E943C010F900F900F900F90CF91DF9160 +:100570001F910F91FF90EF900895809185018F5FFB +:10058000809385010E948A0220918101309182012D +:1005900086E490E0AC01249FC001259F900D349F1C +:1005A000900D112460E470E00E944E097093820166 +:1005B000609381010895AF92BF92CF92DF92EF9244 +:1005C000FF920F931F93CF93DF9380917D019091C2 +:1005D0007E0160E471E00E944E09EB01219680915A +:1005E0007F019091800160E072E00E944E098B01D2 +:1005F0000F5F1F4F4091690150916A01C417D507E1 +:1006000039F480916B0190916C010817190771F012 +:1006100060916B0170916C018AE791E00E94880102 +:100620008AE791E060E270E00E941D01D0936A01C8 +:10063000C093690110936C0100936B018AE791E00C +:1006400060E570E00E946901EE24FF2494E0A92E89 +:10065000B12C81E0C82ED12C80917F019091800136 +:1006600060E470E00E944E0967707070E616F7064D +:10067000D1F480917D0190917E0160E470E00E9450 +:100680004E09CB0165E070E00E944E09B501681B80 +:10069000790BC60102C0880F991F6A95E2F7BC0169 +:1006A0008AE791E004C08AE791E060E070E00E9490 +:1006B0001D010894E11CF11C98E0E916F10461F6B3 +:1006C0008AE791E0B801AE010E9488018AE791E0D3 +:1006D00062E070E00E941D01DF91CF911F910F91A8 +:1006E000FF90EF90DF90CF90BF90AF900895AF92C2 +:1006F000BF92CF92DF92EF92FF920F931F93CF930F +:10070000DF93EC017B018230910510F00E94190A01 +:1007100003E110E0C801C89F8001C99F100DD89F58 +:10072000100D11248AE791E061E070E0A8010E94B9 +:1007300088018AE791E060E270E00E941D018AE78B +:1007400091E062E070E0A8010E9488018AE791E0F0 +:1007500060E270E00E941D01BE01685F7F4F33E0E0 +:10076000660F771F3A95E1F78AE791E00E946901E9 +:10077000CC24DD2427E0A22EB12CAE20BF20CA1449 +:10078000DB0451F0C60101978A159B0529F0C601CB +:1007900001968A159B0561F4209729F48AE791E078 +:1007A00063E070E009C08AE791E068E170E004C0AE +:1007B0008AE791E060E070E00E941D010894C11C8E +:1007C000D11C98E0C916D104D1F688E0E816F104EE +:1007D000C4F48AE791E061E070E0A8010E9488011A +:1007E0008AE791E0BE010E941D018AE791E062E084 +:1007F00070E0A8010E9488018AE791E060E270E061 +:1008000017C08AE791E061E070E0A8010E948801CA +:100810008AE791E060E270E00E941D018AE791E0C2 +:1008200062E070E0A8010E9488018AE791E0BE01C1 +:100830000E941D01DF91CF911F910F91FF90EF90CA +:10084000DF90CF90BF90AF9008951F920F920FB698 +:100850000F9211242F933F934F935F936F937F9346 +:100860008F939F93AF93BF93CF93DF93EF93FF93B8 +:10087000809165010E942F06009719F0C3E0D0E037 +:1008800002C0C0E0D0E0809167010E942F0600976F +:1008900021F081E090E0C827D9272091880130918C +:1008A00089012C1B3D0B20FF0BC0D0938901C09305 +:1008B000880180917B0181502270820F80937B019F +:1008C00080917B0182301CF482E080937B018091D7 +:1008D0007B018D311CF08CE180937B01FF91EF91C6 +:1008E000DF91CF91BF91AF919F918F917F916F9148 +:1008F0005F914F913F912F910F900FBE0F901F90DE +:100900001895CF93DF938AE791E00E942A0280E84E +:1009100090E090937E0180937D0160E070E080E044 +:1009200090E020E130E040E050E00E94D708709372 +:10093000800160937F0180E490E090938201809336 +:1009400081019093840180938301C5E1D0E08AE71F +:1009500091E062E070E0AE010E9488018AE791E0D8 +:1009600060E270E00E941D012196C832D10579F73E +:1009700081E0809385010E948A0210927B0180E0D1 +:1009800090E062E070E00E94770381E090E062E036 +:1009900070E00E947703DF91CF9108951F9310E0DC +:1009A0008AE791E062E070E045E150E00E94880152 +:1009B0008AE791E06BE371E00E943C0164E670E03D +:1009C00080E090E00E94C4068AE791E062E070E077 +:1009D00045E150E00E9488018AE791E066E471E019 +:1009E0000E943C0168EC70E080E090E00E94C40648 +:1009F0001F5F1730A9F668EE73E080E090E00E9478 +:100A0000C40690917B0180917C019817D1F30E94DC +:100A100081041F910895EF92FF92CF93DF9380910D +:100A20007B0180937C01992787FD909562E070E0BF +:100A30000E944E09E62EE7017E01F72EE70180E0D5 +:100A400090E0B7010E9477030E9435020E94DB020A +:100A500080917D0190917E018034910504F5809113 +:100A600081019091820197FF1AC080917F0190913E +:100A7000800160E470E00E944E09970121503040EF +:100A80002617370751F0E616F70639F02196C617F4 +:100A9000D70719F00E94CE0402C00E94BD028091C7 +:100AA000810190918201181619068CF580917D01C3 +:100AB00090917E0121E1803C92074CF120918601CA +:100AC0003091870180917F019091800160E470E016 +:100AD0000E944E09CB01261737074CF42E30310502 +:100AE00034F42F5F3F4F309387012093860120918C +:100AF000860130918701821793074CF4223031052B +:100B000034F021503040309387012093860160916A +:100B100086017091870181E090E00E947703DF9168 +:100B2000CF91FF90EF900895CF93DF931092B00094 +:100B300082E08093B10081E0809370008091650134 +:100B400061E00E94E3058091670161E00E94E30596 +:100B5000CAE7D1E0CE010E949B01CE010E942A0289 +:100B600087E192E040E855E260E070E00E947307A0 +:100B70000E948104DF91CF9108950E94FB060E949C +:100B800094050E940B05FDCF282F30E0C901865641 +:100B90009F4FFC019491F901EA57FF4FE491EE2336 +:100BA00089F0F0E0EE0FFF1FE859FF4FA591B491D7 +:100BB000662329F48C91909589238C9308958C91C8 +:100BC000892B8C930895482F50E0CA0182559F4F7E +:100BD000FC0194919A0126563F4FF9012491FA01A4 +:100BE000EA57FF4FE491EE23C9F1992331F1933095 +:100BF00021F4909180009F7705C0943031F490915A +:100C000080009F7D9093800018C0913019F494B5B6 +:100C10009F7704C0923021F494B59F7D94BD0DC0A0 +:100C2000963021F49091B0009F7705C0973029F459 +:100C30009091B0009F7D9093B000F0E0EE0FFF1F09 +:100C4000EE58FF4FA591B491662329F48C9120951D +:100C500082238C9308958C91822B8C930895282F56 +:100C600030E0C90182559F4FFC019491A90146567D +:100C70005F4FFA014491F901EA57FF4FE491EE23E7 +:100C800019F420E030E036C0992331F1933021F49B +:100C9000909180009F7705C0943031F4909180004E +:100CA0009F7D9093800018C0913019F494B59F7780 +:100CB00004C0923021F494B59F7D94BD0DC0963050 +:100CC00021F49091B0009F7705C0973029F490915E +:100CD000B0009F7D9093B000F0E0EE0FFF1FE4584E +:100CE000FF4FA591B4918C9120E030E0842311F066 +:100CF00021E030E0C90108951F920F920FB60F92C4 +:100D000011242F933F938F939F93AF93BF93809121 +:100D10008E0190918F01A0919001B091910130913D +:100D200092010196A11DB11D232F2D5F2D3720F0BB +:100D30002D570196A11DB11D2093920180938E0124 +:100D400090938F01A0939001B093910180918A01BB +:100D500090918B01A0918C01B0918D010196A11D04 +:100D6000B11D80938A0190938B01A0938C01B09365 +:100D70008D01BF91AF919F918F913F912F910F90D6 +:100D80000FBE0F901F901895EF92FF920F931F9335 +:100D90007B018C018FB7F89420918E0130918F01E7 +:100DA00040919001509191018FBF6FB7F89480915D +:100DB0008E0190918F01A0919001B09191016FBF30 +:100DC000821B930BA40BB50BE816F9060A071B0749 +:100DD00060F71F910F91FF90EF900895019751F0E8 +:100DE000880F991F880F991F02972FB7F8940197C2 +:100DF000F1F72FBF0895789484B5826084BD84B5DF +:100E0000816084BD85B5826085BD85B5816085BD05 +:100E1000EEE6F0E0808181608083E1E8F0E08081AF +:100E200082608083808181608083E0E8F0E080815F +:100E300081608083E1EBF0E0808184608083E0EB7F +:100E4000F0E0808181608083EAE7F0E08081846067 +:100E500080838081826080838081816080838081C3 +:100E6000806880831092C10008951F920F920FB680 +:100E70000F9211242F933F934F935F936F937F9320 +:100E80008F939F93AF93BF93EF93FF934091C600CF +:100E90002091130230911402C901019660E870E0BC +:100EA0000E944E09BC0180911502909116026817AC +:100EB000790741F02D563E4FF9014083709314029B +:100EC00060931302FF91EF91BF91AF919F918F912A +:100ED0007F916F915F914F913F912F910F900FBE36 +:100EE0000F901F9018958F929F92AF92BF92DF92B2 +:100EF000EF92FF920F931F93CF93DF93EC017A0150 +:100F00008B01413482E458078FE0680780E078075E +:100F10000CF07FC060E874E88EE190E0A8019701D2 +:100F20000E948309CA01B90161507040804090401D +:100F300022E030E040E050E00E94830949015A017C +:100F4000A5019401209530954095509594E0220F8D +:100F5000331F441F551F9A95D1F760E074E284EF68 +:100F600090E00E948309CA01B9012FEF30E040E010 +:100F700050E00E942F09A80197010E948309C9012E +:100F800021503F4F121613061CF4D82EDA9403C0DA +:100F9000DD24D394D81A60E079E08DE390E0A801D5 +:100FA00097010E948309CA01B901615070408040D5 +:100FB000904022E030E040E050E00E94830920951C +:100FC00030954095509583E0220F331F441F551FE5 +:100FD0008A95D1F760E074E284EF90E00E94830983 +:100FE000CA01B9012FEF30E040E050E00E942F0924 +:100FF000A80197010E948309C90121503F4F121691 +:1010000013061CF4282F215002C021E0281B2D15A7 +:1010100000F5E885F98581E090E00A8802C0880F34 +:10102000991F0A94E2F7808360E079E08DE390E015 +:10103000A80197010E948309CA01B901615070405B +:101040008040904022E030E040E050E00E94830980 +:1010500004C0E885F98510829401EC81FD8130831C +:10106000EE81FF812083EA85FB85808121E030E0ED +:10107000A9010E8402C0440F551F0A94E2F7842B85 +:101080008083EA85FB858081A9010F8402C0440F1B +:10109000551F0A94E2F7842B8083EA85FB858081C3 +:1010A000088802C0220F331F0A94E2F7822B808344 +:1010B000DF91CF911F910F91FF90EF90DF90BF9044 +:1010C000AF909F908F900895FC01A085B1852189F4 +:1010D0008C9190E0022E02C0959587950A94E2F7D4 +:1010E00080FFF6CF0484F585E02D6083089581E7C5 +:1010F00091E0909318028093170283E991E0909316 +:101100001A028093190285EC90E090931C02809360 +:101110001B0284EC90E090931E0280931D0280ECF1 +:1011200090E09093200280931F0281EC90E09093D6 +:1011300022028093210286EC90E090932402809317 +:10114000230284E08093250283E08093260287E0D7 +:101150008093270285E08093280281E08093290212 +:101160000895EF92FF920F931F937B018C016115FD +:1011700071058105910529F420E030E040E050E060 +:101180000FC00E940B0AA80197010E948309572FE4 +:10119000482F392F862F952FA42FB32F9C01AD01F7 +:1011A000B901CA011F910F91FF90EF900895EF923E +:1011B000FF920F931F937B018C01621773078407C3 +:1011C000950764F4CA01B9016E197F09800B910B70 +:1011D0000E94B108E60EF71E081F191FB701C801CB +:1011E0001F910F91FF90EF9008950F931F93CF934E +:1011F000DF93EC018B0109C00F5F1F4FE881F9817C +:101200000190F081E02DCE010995F80160816623FF +:1012100099F7DF91CF911F910F910895EF92FF926F +:101220000F931F93CF93DF93EC018B017A010DC0D5 +:10123000F80161918F01E881F9810190F081E02D41 +:10124000CE0109950894E108F108E114F10481F751 +:10125000DF91CF911F910F91FF90EF900895629FC2 +:10126000D001739FF001829FE00DF11D649FE00D9E +:10127000F11D929FF00D839FF00D749FF00D659FFF +:10128000F00D9927729FB00DE11DF91F639FB00DFE +:10129000E11DF91FBD01CF011124089597FB092E0F +:1012A00007260AD077FD04D049D006D000201AF4D2 +:1012B000709561957F4F0895F6F7909581959F4FB2 +:1012C0000895A1E21A2EAA1BBB1BFD010DC0AA1F87 +:1012D000BB1FEE1FFF1FA217B307E407F50720F09F +:1012E000A21BB30BE40BF50B661F771F881F991F1A +:1012F0001A9469F760957095809590959B01AC0163 +:10130000BD01CF01089597FB092E05260ED057FD8C +:1013100004D0D7DF0AD0001C38F4509540953095A2 +:1013200021953F4F4F4F5F4F0895F6F79095809569 +:10133000709561957F4F8F4F9F4F0895AA1BBB1BE0 +:1013400051E107C0AA1FBB1FA617B70710F0A61BC5 +:10135000B70B881F991F5A95A9F780959095BC01E6 +:10136000CD010895EE0FFF1F0590F491E02D099433 +:10137000A0E0B0E0EEEBF9E00C94570AEC01E88055 +:10138000F9800A811B81E114F1040105110541F482 +:1013900084E2E82E89EDF82E8BE5082F87E0182FE0 +:1013A000C801B7012DE133EF41E050E00E9483090D +:1013B00027EA31E440E050E00E942F095B016C0114 +:1013C000C801B7012DE133EF41E050E00E948309ED +:1013D000CA01B9012CEE34EF4FEF5FEF0E942F09E5 +:1013E0009B01AC012A0D3B1D4C1D5D1D57FF04C028 +:1013F0002150304040405048288339834A835B83E2 +:101400005F77B901CA01CDB7DEB7EAE00C94730A81 +:101410000E94B809089581E591E00E94B8090895F5 +:101420006093510170935201809353019093540142 +:10143000089581E090E0F8940C94860AFB019F01E6 +:10144000E8944230C4F04532B4F44A3029F497FBB2 +:101450001EF4909581959F4F642F77270E949E09D7 +:10146000805D8A330CF0895D8193CB010097A1F7F1 +:1014700016F45DE251931082C9010C943F0ADC011D +:10148000FC01672F71917723E1F7329704C07C91BB +:101490006D9370836291AE17BF07C8F308952F92C2 +:1014A0003F924F925F926F927F928F929F92AF92F4 +:1014B000BF92CF92DF92EF92FF920F931F93CF9341 +:1014C000DF93CDB7DEB7CA1BDB0B0FB6F894DEBFD8 +:1014D0000FBECDBF09942A88398848885F846E84FE +:1014E0007D848C849B84AA84B984C884DF80EE8048 +:1014F000FD800C811B81AA81B981CE0FD11D0FB651 +:10150000F894DEBF0FBECDBFED010895F894FFCF74 +:101510004C4556454C200041524455494E4F2050B1 +:101520004F494E47007368616C6C2069207072658A +:101530007761726D20736972277320726F746172A4 +:101540007920656E636F6465723F00202020202043 +:1015500020202020200047414D45204F5645522E47 +:10156000000100000002007F0003000400050006E7 +:1015700000070002000B000C000100010000000049 +:08158000006408F5080E0900E3 +:00000001FF diff --git a/projekte/duinopong/duinopong/applet/duinopong.cpp.o b/projekte/duinopong/duinopong/applet/duinopong.cpp.o new file mode 100644 index 0000000..6e6f00e Binary files /dev/null and b/projekte/duinopong/duinopong/applet/duinopong.cpp.o differ diff --git a/projekte/duinopong/duinopong/applet/pins_arduino.c.o b/projekte/duinopong/duinopong/applet/pins_arduino.c.o new file mode 100644 index 0000000..f6f0bed Binary files /dev/null and b/projekte/duinopong/duinopong/applet/pins_arduino.c.o differ diff --git a/projekte/duinopong/duinopong/applet/wiring.c.o b/projekte/duinopong/duinopong/applet/wiring.c.o new file mode 100644 index 0000000..c39c7f3 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/wiring.c.o differ diff --git a/projekte/duinopong/duinopong/applet/wiring_analog.c.o b/projekte/duinopong/duinopong/applet/wiring_analog.c.o new file mode 100644 index 0000000..0ab6564 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/wiring_analog.c.o differ diff --git a/projekte/duinopong/duinopong/applet/wiring_digital.c.o b/projekte/duinopong/duinopong/applet/wiring_digital.c.o new file mode 100644 index 0000000..a769214 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/wiring_digital.c.o differ diff --git a/projekte/duinopong/duinopong/applet/wiring_pulse.c.o b/projekte/duinopong/duinopong/applet/wiring_pulse.c.o new file mode 100644 index 0000000..eeff05e Binary files /dev/null and b/projekte/duinopong/duinopong/applet/wiring_pulse.c.o differ diff --git a/projekte/duinopong/duinopong/applet/wiring_shift.c.o b/projekte/duinopong/duinopong/applet/wiring_shift.c.o new file mode 100644 index 0000000..1428c70 Binary files /dev/null and b/projekte/duinopong/duinopong/applet/wiring_shift.c.o differ diff --git a/projekte/duinopong/duinopong/duinopong.pde b/projekte/duinopong/duinopong/duinopong.pde new file mode 100644 index 0000000..374e0eb --- /dev/null +++ b/projekte/duinopong/duinopong/duinopong.pde @@ -0,0 +1,269 @@ +#include +#include +#include +#include + +#define DEBUG 0 + +LCD4Bit lcd = LCD4Bit(2); + +int pinA = 11; +int pinB = 12; +int ledPin = 13; + +volatile int8_t enc_value = 0; +volatile int8_t enc_value_old = 0; + +void awesome_scroller() { + // the logo + lcd.cursorTo(1,13); + lcd.printIn("ARDUINO POING"); + lcd.cursorTo(2,1); + lcd.printIn("shall i prewarm sir's rotary encoder?"); + + // awesum fx + delay(500); + lcd.cursorTo(2,39); + for (int i=0; i<80; i++) { + lcd.print(' '); + delay(100); + } +} + +#define SCALE 64 +#define COLS 20 +#define PADDLE2_POS (COLS-1) + +int ball_x, ball_y; +int ball_vel_x, ball_vel_y; +uint8_t level; + +void setup_game() { + lcd.clear(); + + // reinit stuff + ball_x = 2*SCALE; + ball_y = random(0,16); + ball_vel_x = 1.0 * SCALE; + ball_vel_y = 1.0 * SCALE; + + // + for (int i=PADDLE2_POS+2; i<=39; i++) { + lcd.cursorTo(2, i); + lcd.print(' '); + } + + // level + level = 1; + display_level(); + + // init paddles + enc_value = 0; + display_paddle(0,2); + display_paddle(1,2); +} + +void setup() { + //Timer2 Settings + TCCR2A = 0; + TCCR2B = 0< 14*ENC_STEPS) + enc_value = 14*ENC_STEPS; +} + + + +void display_paddle (int paddle, int pos) { + #define CHAR_PADDLE paddle + + assert(paddle == 0 || paddle == 1); + + // blank first + lcd.cursorTo(1,paddle*(COLS-1)); lcd.print(' '); + lcd.cursorTo(2,paddle*(COLS-1)); lcd.print(' '); + + // gen char + lcd.commandWrite(0x40+CHAR_PADDLE*8); // char 0b00 + for (uint8_t i = 0; i<8; i++) { + if(i == (pos & 0x7) || i-1 == (pos & 0x7) || i+1 == (pos & 0x7) ) { + if (paddle == 0) { + lcd.print(0b00011); + } else { + lcd.print(0b11000); + } + } else { + lcd.print(0b00000); + } + } + + // display shit + if (pos < 8) { + lcd.cursorTo(1,paddle*PADDLE2_POS); lcd.print(CHAR_PADDLE); + lcd.cursorTo(2,paddle*PADDLE2_POS); lcd.print(' '); + } else { + lcd.cursorTo(1,paddle*PADDLE2_POS); lcd.print(' '); + lcd.cursorTo(2,paddle*PADDLE2_POS); lcd.print(CHAR_PADDLE); + } +} + +#define BALL_X_MAX (COLS-2) +#define res_x BALL_X_MAX*5*SCALE +#define res_y 16*SCALE + +void move_ball () { + ball_x += ball_vel_x; + ball_y += ball_vel_y; + + if (ball_x >= res_x || ball_x < 0) { + ball_vel_x *= -1; + ball_x += ball_vel_x; + } + + if (ball_y >= res_y || ball_y < 0) { + ball_vel_y *= -1; + ball_y += ball_vel_y; + } +} + +int cursor_x_alt = 1; +int cursor_y_alt = 1; + +void display_ball () { + #define CHAR_BALL 2 + + int cursor_x = (ball_x/SCALE)/5+1; + int cursor_y = (ball_y/SCALE)/8+1; + + // first, delete old ball + if (cursor_x != cursor_x_alt || cursor_y != cursor_y_alt) { + lcd.cursorTo(cursor_y_alt, cursor_x_alt); + lcd.print(' '); + } + cursor_x_alt = cursor_x; + cursor_y_alt = cursor_y; + + // second, generate character for new ball + lcd.commandWrite(0x40+CHAR_BALL*8); + for (int i = 0; i<8; i++) { + if(i == ((ball_y/SCALE)&7)) { + lcd.print(1 << 4-(ball_x/SCALE)%5); + } else { + lcd.print(0b00000); + } + } + + // third, write new ball + lcd.cursorTo(cursor_y, cursor_x); + lcd.print(CHAR_BALL); +} + +void game_over() { + for (int8_t i=0; i<7; i++) { + lcd.cursorTo(2, PADDLE2_POS + 2); + lcd.printIn(" "); + delay(100); + + lcd.cursorTo(2, PADDLE2_POS + 2); + lcd.printIn("GAME OVER."); + delay(200); + } + delay(1000); + + while(enc_value == enc_value_old); + setup_game(); +} + +void display_level() { + lcd.cursorTo(1, PADDLE2_POS + 2); + lcd.printIn("LEVEL "); + + char level_str[4]; + itoa(level, level_str, 10); + lcd.printIn(level_str); +} + +void level_up() { + // pump it up + level++; + display_level(); + + // make ball faster + // 70 / 64 is about 1.1 + ball_vel_x = ball_vel_x * 70 / 64; +} + +int player2 = random(1,14); +void loop() { + // move player1's paddle + int val = enc_value; + enc_value_old = val; + display_paddle(0, val/ENC_STEPS); + + // teh ball! + move_ball(); + display_ball(); + + // incoming ball? WIN or FAIL. + if (ball_x/SCALE < 1 && ball_vel_x < 0) { + if (val/ENC_STEPS-1 != ball_y/SCALE + && val/ENC_STEPS != ball_y/SCALE + && val/ENC_STEPS+1 != ball_y/SCALE) { + game_over(); + } else { + level_up(); + } + } + + // fake computer player2 by moving its paddle in + // direction of the ball's vertical position + if (ball_vel_x > 0 && ball_x/SCALE > (BALL_X_MAX-4)*5) { + if (player2 < ball_y/SCALE && player2 < 14) + player2++; + if (player2 > ball_y/SCALE && player2 > 1) + player2--; + } + display_paddle(1, player2); +} diff --git a/projekte/lc-display/HD44780.pdf b/projekte/lc-display/HD44780.pdf new file mode 100644 index 0000000..5cd5f79 Binary files /dev/null and b/projekte/lc-display/HD44780.pdf differ diff --git a/projekte/lc-display/LCD4BitLibrary.zip b/projekte/lc-display/LCD4BitLibrary.zip new file mode 100644 index 0000000..a8b0af7 Binary files /dev/null and b/projekte/lc-display/LCD4BitLibrary.zip differ diff --git a/projekte/lc-display/WD_C2704M_1HNN.pdf b/projekte/lc-display/WD_C2704M_1HNN.pdf new file mode 100644 index 0000000..26107f4 Binary files /dev/null and b/projekte/lc-display/WD_C2704M_1HNN.pdf differ diff --git a/projekte/lc-display/datasheet.pdf b/projekte/lc-display/datasheet.pdf new file mode 100644 index 0000000..af6a1c4 Binary files /dev/null and b/projekte/lc-display/datasheet.pdf differ diff --git a/projekte/lc-display/fnord.pbm b/projekte/lc-display/fnord.pbm new file mode 100644 index 0000000..16129e8 --- /dev/null +++ b/projekte/lc-display/fnord.pbm @@ -0,0 +1,4 @@ +P1 +# CREATOR: GIMP PNM Filter Version 1.1 +5 8 +1000101010101011111101110100011000101010 diff --git a/projekte/lc-display/fnord.xcf b/projekte/lc-display/fnord.xcf new file mode 100644 index 0000000..fa52c8f Binary files /dev/null and b/projekte/lc-display/fnord.xcf differ diff --git a/projekte/lc-display/pbm2fnord.pl b/projekte/lc-display/pbm2fnord.pl new file mode 100644 index 0000000..fb6dd72 --- /dev/null +++ b/projekte/lc-display/pbm2fnord.pl @@ -0,0 +1,14 @@ +#!/usr/bin/perl +use strict; + +my @lines = <>; + + +# P1 +# # CREATOR: GIMP PNM Filter Version 1.1 +# 5 8 +# 1000101010101011111101110100011000101010 + +$lines[0] eq "P1\n" or die "First line should read 'P1' for Plain PBM"; + +for (my $line=0; $line <= $#lines; diff --git a/projekte/lc-display/sharp-lm40a21-fnord.pdf b/projekte/lc-display/sharp-lm40a21-fnord.pdf new file mode 100644 index 0000000..c262bfa Binary files /dev/null and b/projekte/lc-display/sharp-lm40a21-fnord.pdf differ diff --git a/projekte/lc-display/sharp-lm40a21-pins.pdf b/projekte/lc-display/sharp-lm40a21-pins.pdf new file mode 100644 index 0000000..85c303d Binary files /dev/null and b/projekte/lc-display/sharp-lm40a21-pins.pdf differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/HardwareSerial.cpp.o b/projekte/miniledcube/miniledcube_matrix/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..ff3e13c Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/HardwareSerial.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/Print.cpp.o b/projekte/miniledcube/miniledcube_matrix/applet/Print.cpp.o new file mode 100644 index 0000000..1820b34 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/Print.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/WInterrupts.c.o b/projekte/miniledcube/miniledcube_matrix/applet/WInterrupts.c.o new file mode 100644 index 0000000..a93ecc3 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/WInterrupts.c.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/WMath.cpp.o b/projekte/miniledcube/miniledcube_matrix/applet/WMath.cpp.o new file mode 100644 index 0000000..215570c Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/WMath.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/core.a b/projekte/miniledcube/miniledcube_matrix/applet/core.a new file mode 100644 index 0000000..3351593 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/core.a differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp new file mode 100644 index 0000000..e571333 --- /dev/null +++ b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp @@ -0,0 +1,65 @@ +// digital pins 2-7 => kathoden 0-5 +// analog pins 3-5 => kathoden 6-8 +// analog pins 0-2 => anoden A0, B1, C2 + +#include "WProgram.h" +void setup(); +void loop(); +volatile int matrix[9]; + +void setup() { + // digital pins 2-7 + DDRD |= 0b11111100; + // analog pins 0-2 + 3-5 + DDRC |= 0b00111111; + + matrix = { + // ebene 0 + 0b101, + 0b000, + 0b101, + // ebene 1 + 0b000, + 0b010, + 0b000, + // ebene 2 + 0b101, + 0b000, + 0b101, + }; +} + + +void loop() { + for(int ebene=0; ebene<=2; ebene++) { + // *erst* kathoden auf 1 (leuchtet nicht) + PORTD |= 0b11111100; + PORTC |= 0b00111000; + + // anoden auf 0 + PORTC &= 0b11111000; + // unsere anode auf 1 + PORTC |= _BV(ebene+0); + + // kathoden 0-2 => digital-pins 2-4 + PORTD &= ~(matrix[3*ebene + 0] << 2); + // kathoden 3-5 => digital-pins 5-7 + PORTD &= ~(matrix[3*ebene + 1] << 5); + // kathoden 6-8 => analog-pins 3-5 + PORTC &= ~(matrix[3*ebene + 2] << 3); + } +} + + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.eep b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.elf b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.elf new file mode 100755 index 0000000..849e7a8 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.elf differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.hex b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.hex new file mode 100644 index 0000000..b953445 --- /dev/null +++ b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.hex @@ -0,0 +1,43 @@ +:100000000C9434000C9451000C9451000C94510049 +:100010000C9451000C9451000C9451000C9451001C +:100020000C9451000C9451000C9451000C9451000C +:100030000C9451000C9451000C9451000C945100FC +:100040000C94BA000C9451000C9451000C94510083 +:100050000C9451000C9451000C9451000C945100DC +:100060000C9451000C94510011241FBECFEFD4E02A +:10007000DEBFCDBF11E0A0E0B1E0ECE7F2E002C0EE +:1000800005900D92A231B107D9F711E0A2E1B1E0DC +:1000900001C01D92AD32B107E1F70E94B3000C948C +:1000A0003C010C9400008AB18C6F8AB987B18F63D0 +:1000B00087B9A2E1B1E0E0E0F1E082E101900D92C8 +:1000C0008150E1F7089580E090E020E030E061E0C9 +:1000D00070E04BB14C6F4BB948B1486348B948B177 +:1000E000487F48B948B1FB01022E02C0EE0FFF1F46 +:1000F0000A94E2F74E2B48B9ABB1FC01EE0FFF1F9B +:10010000EE5EFE4F40815181440F551F440F551F35 +:1001100040954A234BB9ABB1FC01EE0FFF1FEC5EDB +:10012000FE4F40815181E5E0440F551FEA95E1F70C +:1001300040954A234BB9A8B1FC01EE0FFF1FEA5EC0 +:10014000FE4F40815181E3E0440F551FEA95E1F7EE +:1001500040954A2348B92F5F3F4F0396233031051E +:1001600009F0B7CF08950E9402010E9453000E9437 +:100170006300FDCF1F920F920FB60F9211242F93A1 +:100180003F938F939F93AF93BF938091280190915A +:100190002901A0912A01B0912B0130912C010196E7 +:1001A000A11DB11D232F2D5F2D3720F02D57019656 +:1001B000A11DB11D20932C0180932801909329014A +:1001C000A0932A01B0932B018091240190912501E5 +:1001D000A0912601B09127010196A11DB11D809328 +:1001E000240190932501A0932601B0932701BF918C +:1001F000AF919F918F913F912F910F900FBE0F90D4 +:100200001F901895789484B5826084BD84B5816010 +:1002100084BD85B5826085BD85B5816085BDEEE60E +:10022000F0E0808181608083E1E8F0E0808182609D +:100230008083808181608083E0E8F0E0808181605C +:100240008083E1EBF0E0808184608083E0EBF0E08C +:10025000808181608083EAE7F0E080818460808330 +:1002600080818260808380818160808380818068DA +:0C02700080831092C1000895F894FFCF25 +:10027C000500000005000000020000000500000061 +:02028C0005006B +:00000001FF diff --git a/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.o b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.o new file mode 100644 index 0000000..e964dd3 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/miniledcube_matrix.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/pins_arduino.c.o b/projekte/miniledcube/miniledcube_matrix/applet/pins_arduino.c.o new file mode 100644 index 0000000..f6f0bed Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/pins_arduino.c.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/wiring.c.o b/projekte/miniledcube/miniledcube_matrix/applet/wiring.c.o new file mode 100644 index 0000000..c39c7f3 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/wiring.c.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/wiring_analog.c.o b/projekte/miniledcube/miniledcube_matrix/applet/wiring_analog.c.o new file mode 100644 index 0000000..0ab6564 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/wiring_analog.c.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/wiring_digital.c.o b/projekte/miniledcube/miniledcube_matrix/applet/wiring_digital.c.o new file mode 100644 index 0000000..a769214 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/wiring_digital.c.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/wiring_pulse.c.o b/projekte/miniledcube/miniledcube_matrix/applet/wiring_pulse.c.o new file mode 100644 index 0000000..eeff05e Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/wiring_pulse.c.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/applet/wiring_shift.c.o b/projekte/miniledcube/miniledcube_matrix/applet/wiring_shift.c.o new file mode 100644 index 0000000..1428c70 Binary files /dev/null and b/projekte/miniledcube/miniledcube_matrix/applet/wiring_shift.c.o differ diff --git a/projekte/miniledcube/miniledcube_matrix/miniledcube_matrix.pde b/projekte/miniledcube/miniledcube_matrix/miniledcube_matrix.pde new file mode 100644 index 0000000..dff9e27 --- /dev/null +++ b/projekte/miniledcube/miniledcube_matrix/miniledcube_matrix.pde @@ -0,0 +1,49 @@ +// digital pins 2-7 => kathoden 0-5 +// analog pins 3-5 => kathoden 6-8 +// analog pins 0-2 => anoden A0, B1, C2 + +volatile int matrix[9]; + +void setup() { + // digital pins 2-7 + DDRD |= 0b11111100; + // analog pins 0-2 + 3-5 + DDRC |= 0b00111111; + + matrix = { + // ebene 0 + 0b101, + 0b000, + 0b101, + // ebene 1 + 0b000, + 0b010, + 0b000, + // ebene 2 + 0b101, + 0b000, + 0b101, + }; +} + + +void loop() { + for(int ebene=0; ebene<=2; ebene++) { + // *erst* kathoden auf 1 (leuchtet nicht) + PORTD |= 0b11111100; + PORTC |= 0b00111000; + + // anoden auf 0 + PORTC &= 0b11111000; + // unsere anode auf 1 + PORTC |= _BV(ebene+0); + + // kathoden 0-2 => digital-pins 2-4 + PORTD &= ~(matrix[3*ebene + 0] << 2); + // kathoden 3-5 => digital-pins 5-7 + PORTD &= ~(matrix[3*ebene + 1] << 5); + // kathoden 6-8 => analog-pins 3-5 + PORTC &= ~(matrix[3*ebene + 2] << 3); + } +} + diff --git a/projekte/miniledcube/miniledcube_test/applet/HardwareSerial.cpp.o b/projekte/miniledcube/miniledcube_test/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..ff3e13c Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/HardwareSerial.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/Print.cpp.o b/projekte/miniledcube/miniledcube_test/applet/Print.cpp.o new file mode 100644 index 0000000..1820b34 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/Print.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/WInterrupts.c.o b/projekte/miniledcube/miniledcube_test/applet/WInterrupts.c.o new file mode 100644 index 0000000..a93ecc3 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/WInterrupts.c.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/WMath.cpp.o b/projekte/miniledcube/miniledcube_test/applet/WMath.cpp.o new file mode 100644 index 0000000..215570c Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/WMath.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/core.a b/projekte/miniledcube/miniledcube_test/applet/core.a new file mode 100644 index 0000000..de5aa68 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/core.a differ diff --git a/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp new file mode 100644 index 0000000..4c244ec --- /dev/null +++ b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp @@ -0,0 +1,42 @@ +// digital pins 2-7 => kathoden 1-6 +// analog pins 3-5 => kathoden 7-9 +// analog pins 0-2 => anoden A, B, C + +#include "WProgram.h" +void setup(); +void loop(); +void setup() { + // digital pins 2-7 + DDRD |= 0b11111100; + // analog pins 0-2 + 3-5 + DDRC |= 0b00111111; + + // anoden an + PORTC |= 0b00000111; +} + +void loop() { + // kathoden auf 1 (leuchtet nicht) + PORTD |= 0b11111100; + PORTC |= 0b00111000; + delay(1000); + + // kathoden auf 0 (leuchtet) + PORTD &= 0b00000011; + PORTC &= 0b11000111; + delay(1000); +} + + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.eep b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.elf b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.elf new file mode 100755 index 0000000..cd70028 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.elf differ diff --git a/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.hex b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.hex new file mode 100644 index 0000000..4f9d429 --- /dev/null +++ b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.hex @@ -0,0 +1,39 @@ +:100000000C9434000C9451000C9451000C94510049 +:100010000C9451000C9451000C9451000C9451001C +:100020000C9451000C9451000C9451000C9451000C +:100030000C9451000C9451000C9451000C945100FC +:100040000C947D000C9451000C9451000C945100C0 +:100050000C9451000C9451000C9451000C945100DC +:100060000C9451000C94510011241FBECFEFD4E02A +:10007000DEBFCDBF11E0A0E0B1E0E6E5F2E002C0F6 +:1000800005900D92A030B107D9F711E0A0E0B1E0E2 +:1000900001C01D92A930B107E1F70E9476000C94CF +:1000A00029010C9400008AB18C6F8AB987B18F63E3 +:1000B00087B988B1876088B908958BB18C6F8BB987 +:1000C00088B1886388B968EE73E080E090E00E94B0 +:1000D000C5008BB183708BB988B1877C88B968EE15 +:1000E00073E080E090E00E94C50008950E94EF0058 +:1000F0000E9453000E945D00FDCF1F920F920FB629 +:100100000F9211242F933F938F939F93AF93BF939D +:100110008091040190910501A0910601B091070121 +:10012000309108010196A11DB11D232F2D5F2D37A0 +:1001300020F02D570196A11DB11D20930801809339 +:10014000040190930501A0930601B09307018091EB +:10015000000190910101A0910201B091030101966B +:10016000A11DB11D8093000190930101A093020194 +:10017000B0930301BF91AF919F918F913F912F91C8 +:100180000F900FBE0F901F901895EF92FF920F9354 +:100190001F937B018C018FB7F8942091040130915B +:1001A000050140910601509107018FBF6FB7F89488 +:1001B0008091040190910501A0910601B091070181 +:1001C0006FBF821B930BA40BB50BE816F9060A0749 +:1001D0001B0760F71F910F91FF90EF90089578949F +:1001E00084B5826084BD84B5816084BD85B582603C +:1001F00085BD85B5816085BDEEE6F0E080818160DA +:100200008083E1E8F0E0808182608083808181608A +:100210008083E0E8F0E0808181608083E1EBF0E0C2 +:10022000808184608083E0EBF0E080818160808366 +:10023000EAE7F0E08081846080838081826080834F +:100240008081816080838081806880831092C1007A +:060250000895F894FFCFB1 +:00000001FF diff --git a/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.o b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.o new file mode 100644 index 0000000..456fe2d Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/miniledcube_test.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/pins_arduino.c.o b/projekte/miniledcube/miniledcube_test/applet/pins_arduino.c.o new file mode 100644 index 0000000..f6f0bed Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/pins_arduino.c.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/wiring.c.o b/projekte/miniledcube/miniledcube_test/applet/wiring.c.o new file mode 100644 index 0000000..c39c7f3 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/wiring.c.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/wiring_analog.c.o b/projekte/miniledcube/miniledcube_test/applet/wiring_analog.c.o new file mode 100644 index 0000000..0ab6564 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/wiring_analog.c.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/wiring_digital.c.o b/projekte/miniledcube/miniledcube_test/applet/wiring_digital.c.o new file mode 100644 index 0000000..a769214 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/wiring_digital.c.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/wiring_pulse.c.o b/projekte/miniledcube/miniledcube_test/applet/wiring_pulse.c.o new file mode 100644 index 0000000..eeff05e Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/wiring_pulse.c.o differ diff --git a/projekte/miniledcube/miniledcube_test/applet/wiring_shift.c.o b/projekte/miniledcube/miniledcube_test/applet/wiring_shift.c.o new file mode 100644 index 0000000..1428c70 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test/applet/wiring_shift.c.o differ diff --git a/projekte/miniledcube/miniledcube_test/miniledcube_test.pde b/projekte/miniledcube/miniledcube_test/miniledcube_test.pde new file mode 100644 index 0000000..8a0a28f --- /dev/null +++ b/projekte/miniledcube/miniledcube_test/miniledcube_test.pde @@ -0,0 +1,26 @@ +// digital pins 2-7 => kathoden 1-6 +// analog pins 3-5 => kathoden 7-9 +// analog pins 0-2 => anoden A, B, C + +void setup() { + // digital pins 2-7 + DDRD |= 0b11111100; + // analog pins 0-2 + 3-5 + DDRC |= 0b00111111; + + // anoden an + PORTC |= 0b00000111; +} + +void loop() { + // kathoden auf 1 (leuchtet nicht) + PORTD |= 0b11111100; + PORTC |= 0b00111000; + delay(1000); + + // kathoden auf 0 (leuchtet) + PORTD &= 0b00000011; + PORTC &= 0b11000111; + delay(1000); +} + diff --git a/projekte/miniledcube/miniledcube_test2/applet/HardwareSerial.cpp.o b/projekte/miniledcube/miniledcube_test2/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..ff3e13c Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/HardwareSerial.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/Print.cpp.o b/projekte/miniledcube/miniledcube_test2/applet/Print.cpp.o new file mode 100644 index 0000000..1820b34 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/Print.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/WInterrupts.c.o b/projekte/miniledcube/miniledcube_test2/applet/WInterrupts.c.o new file mode 100644 index 0000000..a93ecc3 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/WInterrupts.c.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/WMath.cpp.o b/projekte/miniledcube/miniledcube_test2/applet/WMath.cpp.o new file mode 100644 index 0000000..215570c Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/WMath.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/core.a b/projekte/miniledcube/miniledcube_test2/applet/core.a new file mode 100644 index 0000000..bfe9eb3 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/core.a differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp new file mode 100644 index 0000000..99aa8cf --- /dev/null +++ b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp @@ -0,0 +1,52 @@ +// digital pins 2-7 => kathoden 0-5 +// analog pins 3-5 => kathoden 6-8 +// analog pins 0-2 => anoden A0, B1, C2 + +#include "WProgram.h" +void setup(); +void loop(); +void setup() { + // digital pins 2-7 + DDRD |= 0b11111100; + // analog pins 0-2 + 3-5 + DDRC |= 0b00111111; +} + + +void loop() { + for(int ebene=0; ebene<=2; ebene++) { + // anoden auf 0 + PORTC &= 0b11111000; + // unsere anode auf 1 + PORTC |= _BV(ebene+0); + + for (int kathode=0; kathode<=8; kathode++) { + // kathoden auf 1 (leuchtet nicht) + PORTD |= 0b11111100; + PORTC |= 0b00111000; + + // unsere kathode auf 0 (leuchtet) + if (kathode <= 5) { + PORTD &= ~_BV(kathode+2); + } + if (kathode >= 6 && kathode <= 8) { + PORTC &= ~_BV(kathode-6+3); + } + delay(400); + } + } +} + + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.eep b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.elf b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.elf new file mode 100755 index 0000000..8550039 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.elf differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.hex b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.hex new file mode 100644 index 0000000..5bfde10 --- /dev/null +++ b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.hex @@ -0,0 +1,46 @@ +:100000000C9434000C9451000C9451000C94510049 +:100010000C9451000C9451000C9451000C9451001C +:100020000C9451000C9451000C9451000C9451000C +:100030000C9451000C9451000C9451000C945100FC +:100040000C94B9000C9451000C9451000C94510084 +:100050000C9451000C9451000C9451000C945100DC +:100060000C9451000C94510011241FBECFEFD4E02A +:10007000DEBFCDBF11E0A0E0B1E0EEECF2E002C0E7 +:1000800005900D92A030B107D9F711E0A0E0B1E0E2 +:1000900001C01D92A930B107E1F70E94AE000C9497 +:1000A00065010C940000EF92FF920F931F93CF9382 +:1000B000DF9300E010E081E0E82EF12C88B1887F2A +:1000C00088B988B19701002E02C0220F331F0A940D +:1000D000E2F7822B88B9C0E0D0E08BB18C6F8BB98E +:1000E00088B1886388B9C630D10574F49BB19E018C +:1000F0002E5F3F4FA70102C0440F551F2A95E2F71C +:10010000842F809589238BB9CE0106978330910582 +:1001100070F498B19E0123503040A70102C0440FF3 +:10012000551F2A95E2F7842F8095892388B960E9C5 +:1001300071E080E090E00E9401012196C930D10574 +:1001400061F60F5F1F4F0330110509F0B7CFDF9144 +:10015000CF911F910F91FF90EF9008950E942B0176 +:100160008AB18C6F8AB987B18F6387B90E945300B7 +:10017000FDCF1F920F920FB60F9211242F933F9332 +:100180008F939F93AF93BF9380910401909105014A +:10019000A0910601B0910701309108010196A11DBF +:1001A000B11D232F2D5F2D3720F02D570196A11D56 +:1001B000B11D209308018093040190930501A09341 +:1001C0000601B09307018091000190910101A09177 +:1001D0000201B09103010196A11DB11D80930001A0 +:1001E00090930101A0930201B0930301BF91AF91DD +:1001F0009F918F913F912F910F900FBE0F901F9065 +:100200001895EF92FF920F931F937B018C018FB78C +:10021000F89420910401309105014091060150911C +:1002200007018FBF6FB7F894809104019091050189 +:10023000A0910601B09107016FBF821B930BA40B25 +:10024000B50BE816F9060A071B0760F71F910F9117 +:10025000FF90EF900895789484B5826084BD84B552 +:10026000816084BD85B5826085BD85B5816085BDB1 +:10027000EEE6F0E0808181608083E1E8F0E080815B +:1002800082608083808181608083E0E8F0E080810B +:1002900081608083E1EBF0E0808184608083E0EB2B +:1002A000F0E0808181608083EAE7F0E08081846013 +:1002B000808380818260808380818160808380816F +:0E02C000806880831092C1000895F894FFCFEB +:00000001FF diff --git a/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.o b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.o new file mode 100644 index 0000000..8b2e522 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/miniledcube_test2.cpp.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/pins_arduino.c.o b/projekte/miniledcube/miniledcube_test2/applet/pins_arduino.c.o new file mode 100644 index 0000000..f6f0bed Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/pins_arduino.c.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/wiring.c.o b/projekte/miniledcube/miniledcube_test2/applet/wiring.c.o new file mode 100644 index 0000000..c39c7f3 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/wiring.c.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/wiring_analog.c.o b/projekte/miniledcube/miniledcube_test2/applet/wiring_analog.c.o new file mode 100644 index 0000000..0ab6564 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/wiring_analog.c.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/wiring_digital.c.o b/projekte/miniledcube/miniledcube_test2/applet/wiring_digital.c.o new file mode 100644 index 0000000..a769214 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/wiring_digital.c.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/wiring_pulse.c.o b/projekte/miniledcube/miniledcube_test2/applet/wiring_pulse.c.o new file mode 100644 index 0000000..eeff05e Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/wiring_pulse.c.o differ diff --git a/projekte/miniledcube/miniledcube_test2/applet/wiring_shift.c.o b/projekte/miniledcube/miniledcube_test2/applet/wiring_shift.c.o new file mode 100644 index 0000000..1428c70 Binary files /dev/null and b/projekte/miniledcube/miniledcube_test2/applet/wiring_shift.c.o differ diff --git a/projekte/miniledcube/miniledcube_test2/miniledcube_test2.pde b/projekte/miniledcube/miniledcube_test2/miniledcube_test2.pde new file mode 100644 index 0000000..291b858 --- /dev/null +++ b/projekte/miniledcube/miniledcube_test2/miniledcube_test2.pde @@ -0,0 +1,36 @@ +// digital pins 2-7 => kathoden 0-5 +// analog pins 3-5 => kathoden 6-8 +// analog pins 0-2 => anoden A0, B1, C2 + +void setup() { + // digital pins 2-7 + DDRD |= 0b11111100; + // analog pins 0-2 + 3-5 + DDRC |= 0b00111111; +} + + +void loop() { + for(int ebene=0; ebene<=2; ebene++) { + // anoden auf 0 + PORTC &= 0b11111000; + // unsere anode auf 1 + PORTC |= _BV(ebene+0); + + for (int kathode=0; kathode<=8; kathode++) { + // kathoden auf 1 (leuchtet nicht) + PORTD |= 0b11111100; + PORTC |= 0b00111000; + + // unsere kathode auf 0 (leuchtet) + if (kathode <= 5) { + PORTD &= ~_BV(kathode+2); + } + if (kathode >= 6 && kathode <= 8) { + PORTC &= ~_BV(kathode-6+3); + } + delay(400); + } + } +} + diff --git a/projekte/oszi-grafik/Club_vorher-13.jpg b/projekte/oszi-grafik/Club_vorher-13.jpg new file mode 100644 index 0000000..92e300f Binary files /dev/null and b/projekte/oszi-grafik/Club_vorher-13.jpg differ diff --git a/projekte/oszi-grafik/SparkFunEagle-11-03-09.zip b/projekte/oszi-grafik/SparkFunEagle-11-03-09.zip new file mode 100644 index 0000000..2252b77 Binary files /dev/null and b/projekte/oszi-grafik/SparkFunEagle-11-03-09.zip differ diff --git a/projekte/oszi-grafik/dac_test/applet/HardwareSerial.cpp.o b/projekte/oszi-grafik/dac_test/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..ff3e13c Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/HardwareSerial.cpp.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/Print.cpp.o b/projekte/oszi-grafik/dac_test/applet/Print.cpp.o new file mode 100644 index 0000000..1820b34 Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/Print.cpp.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/WInterrupts.c.o b/projekte/oszi-grafik/dac_test/applet/WInterrupts.c.o new file mode 100644 index 0000000..a93ecc3 Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/WInterrupts.c.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/WMath.cpp.o b/projekte/oszi-grafik/dac_test/applet/WMath.cpp.o new file mode 100644 index 0000000..215570c Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/WMath.cpp.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/core.a b/projekte/oszi-grafik/dac_test/applet/core.a new file mode 100644 index 0000000..4481817 Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/core.a differ diff --git a/projekte/oszi-grafik/dac_test/applet/dac_test.cpp b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp new file mode 100644 index 0000000..2309401 --- /dev/null +++ b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp @@ -0,0 +1,39 @@ +#include "WProgram.h" +void setup(); +void loop(); +void setup() { + pinMode(7, OUTPUT); + pinMode(6, OUTPUT); + pinMode(5, OUTPUT); + pinMode(4, OUTPUT); + pinMode(3, OUTPUT); + pinMode(2, OUTPUT); +} + +int count = 0; + +void loop() +{ + digitalWrite(7, (count & 0b100000) >> 5); + digitalWrite(6, (count & 0b010000) >> 4); + digitalWrite(5, (count & 0b001000) >> 3); + digitalWrite(4, (count & 0b000100) >> 2); + digitalWrite(3, (count & 0b000010) >> 1); + digitalWrite(2, (count & 0b000001) >> 0); + + delay(1000); + count++; +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.eep b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.elf b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.elf new file mode 100755 index 0000000..72058aa Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.elf differ diff --git a/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.hex b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.hex new file mode 100644 index 0000000..39f519d --- /dev/null +++ b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.hex @@ -0,0 +1,68 @@ +:100000000C9461000C947E000C947E000C947E0095 +:100010000C947E000C947E000C947E000C947E0068 +:100020000C947E000C947E000C947E000C947E0058 +:100030000C947E000C947E000C947E000C947E0048 +:100040000C9463010C947E000C947E000C947E0052 +:100050000C947E000C947E000C947E000C947E0028 +:100060000C947E000C947E00000000002400270009 +:100070002A0000000000250028002B0000000000DE +:1000800023002600290004040404040404040202DA +:100090000202020203030303030301020408102007 +:1000A0004080010204081020010204081020000012 +:1000B0000007000201000003040600000000000029 +:1000C000000011241FBECFEFD4E0DEBFCDBF11E092 +:1000D000A0E0B1E0E2E2F4E002C005900D92A030B1 +:1000E000B107D9F711E0A0E0B1E001C01D92AB303B +:1000F000B107E1F70E94F1000C940F020C9400008C +:1001000060910001709101016072707045E0759519 +:1001100067954A95E1F787E00E9417016091000119 +:10012000709101016071707034E0759567953A9532 +:10013000E1F786E00E9417016091000170910101D2 +:100140006870707023E0759567952A95E1F785E0F2 +:100150000E9417016091000170910101647070703C +:10016000759567957595679584E00E941701609174 +:10017000000170910101627070707595679583E060 +:100180000E94170160910001617082E00E941701D6 +:1001900068EE73E080E090E00E94AB018091000186 +:1001A00090910101019690930101809300010895BF +:1001B00087E061E00E94F80086E061E00E94F800BC +:1001C00085E061E00E94F80084E061E00E94F800B0 +:1001D00083E061E00E94F80082E061E00E94F800A4 +:1001E00008950E94D5010E94D8000E948000FDCF92 +:1001F000282F30E0C90186569F4FFC019491F901E8 +:10020000EA57FF4FE491EE2389F0F0E0EE0FFF1F75 +:10021000E859FF4FA591B491662329F48C919095EC +:1002200089238C9308958C91892B8C930895482F62 +:1002300050E0CA0182559F4FFC0194919A012656C5 +:100240003F4FF9012491FA01EA57FF4FE491EE2361 +:10025000C9F1992331F1933021F4909180009F7777 +:1002600005C0943031F4909180009F7D9093800080 +:1002700018C0913019F494B59F7704C0923021F4DE +:1002800094B59F7D94BD0DC0963021F49091B0003F +:100290009F7705C0973029F49091B0009F7D90938F +:1002A000B000F0E0EE0FFF1FEE58FF4FA591B491A4 +:1002B000662329F48C91209582238C9308958C9148 +:1002C000822B8C9308951F920F920FB60F921124D8 +:1002D0002F933F938F939F93AF93BF93809106018A +:1002E00090910701A0910801B091090130910A0194 +:1002F0000196A11DB11D232F2D5F2D3720F02D5705 +:100300000196A11DB11D20930A01809306019093CF +:100310000701A0930801B093090180910201909117 +:100320000301A0910401B09105010196A11DB11D29 +:100330008093020190930301A0930401B0930501FF +:10034000BF91AF919F918F913F912F910F900FBED1 +:100350000F901F901895EF92FF920F931F937B01C0 +:100360008C018FB7F89420910601309107014091DC +:100370000801509109018FBF6FB7F8948091060171 +:1003800090910701A0910801B09109016FBF821BF4 +:10039000930BA40BB50BE816F9060A071B0760F7C9 +:1003A0001F910F91FF90EF900895789484B582602B +:1003B00084BD84B5816084BD85B5826085BD85B509 +:1003C000816085BDEEE6F0E0808181608083E1E8B8 +:1003D000F0E0808182608083808181608083E0E8BA +:1003E000F0E0808181608083E1EBF0E080818460D7 +:1003F0008083E0EBF0E0808181608083EAE7F0E0D9 +:10040000808184608083808182608083808181603C +:1004100080838081806880831092C1000895F89461 +:02042000FFCF0C +:00000001FF diff --git a/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.o b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.o new file mode 100644 index 0000000..619cf99 Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/dac_test.cpp.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/pins_arduino.c.o b/projekte/oszi-grafik/dac_test/applet/pins_arduino.c.o new file mode 100644 index 0000000..f6f0bed Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/pins_arduino.c.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/wiring.c.o b/projekte/oszi-grafik/dac_test/applet/wiring.c.o new file mode 100644 index 0000000..c39c7f3 Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/wiring.c.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/wiring_analog.c.o b/projekte/oszi-grafik/dac_test/applet/wiring_analog.c.o new file mode 100644 index 0000000..0ab6564 Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/wiring_analog.c.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/wiring_digital.c.o b/projekte/oszi-grafik/dac_test/applet/wiring_digital.c.o new file mode 100644 index 0000000..a769214 Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/wiring_digital.c.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/wiring_pulse.c.o b/projekte/oszi-grafik/dac_test/applet/wiring_pulse.c.o new file mode 100644 index 0000000..eeff05e Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/wiring_pulse.c.o differ diff --git a/projekte/oszi-grafik/dac_test/applet/wiring_shift.c.o b/projekte/oszi-grafik/dac_test/applet/wiring_shift.c.o new file mode 100644 index 0000000..1428c70 Binary files /dev/null and b/projekte/oszi-grafik/dac_test/applet/wiring_shift.c.o differ diff --git a/projekte/oszi-grafik/dac_test/dac_test.pde b/projekte/oszi-grafik/dac_test/dac_test.pde new file mode 100644 index 0000000..0bde5bb --- /dev/null +++ b/projekte/oszi-grafik/dac_test/dac_test.pde @@ -0,0 +1,23 @@ +void setup() { + pinMode(7, OUTPUT); + pinMode(6, OUTPUT); + pinMode(5, OUTPUT); + pinMode(4, OUTPUT); + pinMode(3, OUTPUT); + pinMode(2, OUTPUT); +} + +int count = 0; + +void loop() +{ + digitalWrite(7, (count & 0b100000) >> 5); + digitalWrite(6, (count & 0b010000) >> 4); + digitalWrite(5, (count & 0b001000) >> 3); + digitalWrite(4, (count & 0b000100) >> 2); + digitalWrite(3, (count & 0b000010) >> 1); + digitalWrite(2, (count & 0b000001) >> 0); + + delay(1000); + count++; +} diff --git a/projekte/oszi-grafik/tda8702.pdf b/projekte/oszi-grafik/tda8702.pdf new file mode 100644 index 0000000..cf45fdb Binary files /dev/null and b/projekte/oszi-grafik/tda8702.pdf differ diff --git a/projekte/soundz/alex_sound1/alex_sound1.pde b/projekte/soundz/alex_sound1/alex_sound1.pde new file mode 100644 index 0000000..090a80e --- /dev/null +++ b/projekte/soundz/alex_sound1/alex_sound1.pde @@ -0,0 +1,233 @@ +/* + * speaker_pcm + * + * Plays 8-bit PCM audio on pin 11 using pulse-width modulation (PWM). + * For Arduino with Atmega168 at 16 MHz. + * + * Uses two timers. The first changes the sample value 8000 times a second. + * The second holds pin 11 high for 0-255 ticks out of a 256-tick cycle, + * depending on sample value. The second timer repeats 62500 times per second + * (16000000 / 256), much faster than the playback rate (8000 Hz), so + * it almost sounds halfway decent, just really quiet on a PC speaker. + * + * Takes over Timer 1 (16-bit) for the 8000 Hz timer. This breaks PWM + * (analogWrite()) for Arduino pins 9 and 10. Takes Timer 2 (8-bit) + * for the pulse width modulation, breaking PWM for pins 11 & 3. + * + * References: + * http://www.uchobby.com/index.php/2007/11/11/arduino-sound-part-1/ + * http://www.atmel.com/dyn/resources/prod_documents/doc2542.pdf + * http://www.evilmadscientist.com/article.php/avrdac + * http://gonium.net/md/2006/12/27/i-will-think-before-i-code/ + * http://fly.cc.fer.hr/GDM/articles/sndmus/speaker2.html + * http://www.gamedev.net/reference/articles/article442.asp + * + * Michael Smith + */ + +#include +#include +#include +#include +#include + +#define SAMPLE_RATE 8000 + + + + +/* + * The audio data needs to be unsigned, 8-bit, 8000 Hz, and small enough + * to fit in flash. 10000-13000 samples is about the limit. + * + * sounddata.h should look like this: + * const int sounddata_length=10000; + * const unsigned char sounddata_data[] PROGMEM = { ..... }; + * + * You can use wav2c from GBA CSS: + * http://thieumsweb.free.fr/english/gbacss.html + * Then add "PROGMEM" in the right place. I hacked it up to dump the samples + * as unsigned rather than signed, but it shouldn't matter. + * + * http://musicthing.blogspot.com/2005/05/tiny-music-makers-pt-4-mac-startup.html + * mplayer -ao pcm macstartup.mp3 + * sox audiodump.wav -v 1.32 -c 1 -r 8000 -u -1 macstartup-8000.wav + * sox macstartup-8000.wav macstartup-cut.wav trim 0 10000s + * wav2c macstartup-cut.wav sounddata.h sounddata + * + * (starfox) nb. under sox 12.18 (distributed in CentOS 5), i needed to run + * the following command to convert my wav file to the appropriate format: + * sox audiodump.wav -c 1 -r 8000 -u -b macstartup-8000.wav + */ + +int ledPin = 13; +int speakerPin = 11; +volatile uint16_t sample1; +volatile uint16_t sample2; +byte lastSample; + +prog_uint8_t sintab[] = { + 0x01,0x01,0x01,0x01,0x02,0x03,0x05,0x07, + 0x09,0x0c,0x0f,0x12,0x15,0x19,0x1c,0x21, + 0x25,0x29,0x2e,0x33,0x38,0x3d,0x43,0x48, + 0x4e,0x54,0x5a,0x60,0x66,0x6c,0x73,0x79, + 0x7f,0x85,0x8b,0x92,0x98,0x9e,0xa4,0xaa, + 0xb0,0xb6,0xbb,0xc1,0xc6,0xcb,0xd0,0xd5, + 0xd9,0xdd,0xe2,0xe5,0xe9,0xec,0xef,0xf2, + 0xf5,0xf7,0xf9,0xfb,0xfc,0xfd,0xfe,0xfe, + 0xfe,0xfe,0xfe,0xfd,0xfc,0xfb,0xf9,0xf7, + 0xf5,0xf2,0xef,0xec,0xe9,0xe5,0xe2,0xdd, + 0xd9,0xd5,0xd0,0xcb,0xc6,0xc1,0xbb,0xb6, + 0xb0,0xaa,0xa4,0x9e,0x98,0x92,0x8b,0x85, + 0x7f,0x79,0x73,0x6c,0x66,0x60,0x5a,0x54, + 0x4e,0x48,0x43,0x3d,0x38,0x33,0x2e,0x29, + 0x25,0x21,0x1c,0x19,0x15,0x12,0x0f,0x0c, + 0x09,0x07,0x05,0x03,0x02,0x01,0x01,0x01 +}; + +volatile uint16_t tone1_h; +volatile uint16_t tone2_h; + +// This is called at 8000 Hz to load the next sample. +ISR(TIMER1_COMPA_vect) { + OCR2A = (pgm_read_byte(&sintab[sample1 / 512]) + + pgm_read_byte(&sintab[sample2 / 512])) / 2; + +// OCR2A = pgm_read_byte(&sintab[sample1 / 512]); + sample1 = (sample1 + tone1_h); + sample2 = (sample2 + tone2_h); +} + +void startPlayback() +{ + pinMode(speakerPin, OUTPUT); + + // Set up Timer 2 to do pulse width modulation on the speaker + // pin. + + // Use internal clock (datasheet p.160) + ASSR &= ~(_BV(EXCLK) | _BV(AS2)); + + // Set fast PWM mode (p.157) + TCCR2A |= _BV(WGM21) | _BV(WGM20); + TCCR2B &= ~_BV(WGM22); + + // Do non-inverting PWM on pin OC2A (p.155) + // On the Arduino this is pin 11. + TCCR2A = (TCCR2A | _BV(COM2A1)) & ~_BV(COM2A0); + TCCR2A &= ~(_BV(COM2B1) | _BV(COM2B0)); + + // No prescaler (p.158) + TCCR2B = (TCCR2B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Set initial pulse width to the first sample. + OCR2A = 0; + + + // Set up Timer 1 to send a sample every interrupt. + + cli(); + + // Set CTC mode (Clear Timer on Compare Match) (p.133) + // Have to set OCR1A *after*, otherwise it gets reset to 0! + TCCR1B = (TCCR1B & ~_BV(WGM13)) | _BV(WGM12); + TCCR1A = TCCR1A & ~(_BV(WGM11) | _BV(WGM10)); + + // No prescaler (p.134) + TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Set the compare register (OCR1A). + // OCR1A is a 16-bit register, so we have to do this with + // interrupts disabled to be safe. + OCR1A = F_CPU / SAMPLE_RATE; // 16e6 / 8000 = 2000 + + // Enable interrupt when TCNT1 == OCR1A (p.136) + TIMSK1 |= _BV(OCIE1A); + + + sei(); +} + +void stopPlayback() +{ + // Disable playback per-sample interrupt. + TIMSK1 &= ~_BV(OCIE1A); + + // Disable the per-sample timer completely. + TCCR1B &= ~_BV(CS10); + + // Disable the PWM timer. + TCCR2B &= ~_BV(CS10); + + digitalWrite(speakerPin, LOW); +} + +void setup() +{ + pinMode(ledPin, OUTPUT); + tone1_h = 10; + tone2_h = 10; + startPlayback(); +} + +void arpeggio(int32_t n1, int32_t n2, int32_t n3, int32_t len) { + tone1_h = 16000/n1; + tone2_h = 16000/n2; + _delay_ms(50*len); +} + +void loop() +{ + + for(;;) { + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(261,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(293,246,146,6); + arpeggio(246,196,99,7); + arpeggio(261,220,99,4); + arpeggio(293,246,99,6); + arpeggio(246,196,99,6); + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(262,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(246,196,99,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + _delay_ms(3000); + } + +} + + diff --git a/projekte/soundz/alex_sound1/sound_alex2_nochmal/sound_alex2_nochmal.pde b/projekte/soundz/alex_sound1/sound_alex2_nochmal/sound_alex2_nochmal.pde new file mode 100644 index 0000000..e01f351 --- /dev/null +++ b/projekte/soundz/alex_sound1/sound_alex2_nochmal/sound_alex2_nochmal.pde @@ -0,0 +1,235 @@ +/* +* Theremin - Arduino Physical Computing für Bastler, Designer & Geeks + * + * Soundcode von: Michael Smith - http://www.arduino.cc/playground/Code/PCMAudio + * CapSense: http://www.arduino.cc/playground/Main/CapSense + * + * Alex Wenger 2009 + */ +#include +#include +#include +#include +#include + +// Audioausgabe +#define SAMPLE_RATE 8000 + +// Auf welchem PIN soll Audio ausgegeben werden? (nicht Ändern!!!) +int speakerPin = 11; + +const unsigned char sintab[] PROGMEM = { + 0x01,0x01,0x01,0x01,0x02,0x03,0x05,0x07, + 0x09,0x0c,0x0f,0x12,0x15,0x19,0x1c,0x21, + 0x25,0x29,0x2e,0x33,0x38,0x3d,0x43,0x48, + 0x4e,0x54,0x5a,0x60,0x66,0x6c,0x73,0x79, + 0x7f,0x85,0x8b,0x92,0x98,0x9e,0xa4,0xaa, + 0xb0,0xb6,0xbb,0xc1,0xc6,0xcb,0xd0,0xd5, + 0xd9,0xdd,0xe2,0xe5,0xe9,0xec,0xef,0xf2, + 0xf5,0xf7,0xf9,0xfb,0xfc,0xfd,0xfe,0xfe, + 0xfe,0xfe,0xfe,0xfd,0xfc,0xfb,0xf9,0xf7, + 0xf5,0xf2,0xef,0xec,0xe9,0xe5,0xe2,0xdd, + 0xd9,0xd5,0xd0,0xcb,0xc6,0xc1,0xbb,0xb6, + 0xb0,0xaa,0xa4,0x9e,0x98,0x92,0x8b,0x85, + 0x7f,0x79,0x73,0x6c,0x66,0x60,0x5a,0x54, + 0x4e,0x48,0x43,0x3d,0x38,0x33,0x2e,0x29, + 0x25,0x21,0x1c,0x19,0x15,0x12,0x0f,0x0c, + 0x09,0x07,0x05,0x03,0x02,0x01,0x01,0x01 +}; + + +volatile uint16_t sample1; // welches ist das nächste Sample aus der Sinustabelle +// die oberen 7 bit zeigen in die Tabelle, die restlichen +// bits sind kommastellen +volatile uint16_t sample2; +volatile uint16_t sample3; + +uint16_t vol; // aktuelle Lautstärke +volatile uint16_t set_vol; // gewuenschte Lautstärke +volatile uint16_t tone1; // Tonhöhe in "Inkrementiereinheiten" +volatile uint16_t tone2; // Tonhöhe in "Inkrementiereinheiten" +volatile uint16_t tone3; // Tonhöhe in "Inkrementiereinheiten" + + +// Interruptroutine, diese wird 8000 mal pro Sekunde aufgerufen und berechnet den nächsten +// Wert für die Tonausgabe +ISR(TIMER1_COMPA_vect) { + static int timer1counter; // Zähler um Lautstärkeänderung langsamer zu machen + int wert; + + // Wert an der Stelle sample1/512 aus der sinus-Tabelle lesen + wert = pgm_read_byte(&sintab[(sample1 >> 9)])+ + pgm_read_byte(&sintab[(sample2 >> 9)])+ + pgm_read_byte(&sintab[(sample3 >> 9)]); + // Wert mit der aktuellen Lautstärke multiplizieren + wert = (wert * vol) / 256; + // PWM Hardware anweisen ab jetzt diesen Wert auszugeben + OCR2A = wert; + + // nächstes Sample in der Sinustabelle abhängig vom gewünschten + // Ton auswählen. + sample1 += tone1; + sample2 += tone2; + sample3 += tone3; + + // Lautstärke anpassen wen gewünscht (nur alle 50 Interrupts, damit + // es schön langsam passiert. + timer1counter++; + if (timer1counter > 50) + { + timer1counter = 0; + if (vol < set_vol) vol++; + if (vol > set_vol) vol--; + } +} + +void startPlayback() +{ + pinMode(speakerPin, OUTPUT); + + // Initialisiere den Timer 2 für die schnelle PWM zur + // Soundausgabe auf Pin 11 + + // Verwende den internen Takt (Datenblatt Seite 160) + ASSR &= ~(_BV(EXCLK) | _BV(AS2)); + + // Fast PWM mode (Seite 157) + TCCR2A |= _BV(WGM21) | _BV(WGM20); + TCCR2B &= ~_BV(WGM22); + + // Wähle die nicht invertierende PWM für pin OC2A und OC2B + // Am Arduino ist das Pin 11 und 3 + TCCR2A = (TCCR2A | _BV(COM2A1) | _BV(COM2B1)); + + // Keine Vorteiler / wir wollen es schnell! (Seite 158) + TCCR2B = (TCCR2B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Start Wert = 0, sonst gibt es ein hässliches Ploppgeräusch + OCR2A = 0; + OCR2B = 0; + + // Initialisiere Timer 1 für 8000 Interrupts/Sekunde + cli(); + + // Set CTC mode (Clear Timer on Compare Match) (Seite 133) + TCCR1B = (TCCR1B & ~_BV(WGM13)) | _BV(WGM12); + TCCR1A = TCCR1A & ~(_BV(WGM11) | _BV(WGM10)); + + // Kein Vorteiler (Seite 134) + TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Gewünschte Frequenz = 8000kHz + OCR1A = F_CPU / SAMPLE_RATE; // 16e6 / 8000 = 2000 + + // Aktiviere den Interrupt für TCNT1 == OCR1A (Seite 136) + TIMSK1 |= _BV(OCIE1A); + + // Startwerte + sample1 = 0; + sample2 = 0; + sample3 = 0; + + // Global Interrupts wieder einschalten. + sei(); +} + +// Aendert Ton und Lautstärke +// ton (50-4000Hz) +// volume (0-256); +void SetFreq(int ton1,int ton2, int ton3, int volume) +{ + tone1 = (128ul*512ul*ton1)/8000; + tone2 = (128ul*512ul*ton2)/8000; + tone3 = (128ul*512ul*ton3)/8000; + set_vol = volume; +} + +void setup() +{ + startPlayback(); +} + +uint8_t st1_mod = 1; +uint8_t st2_mod = 1; +uint8_t st3_mod = 1; +uint8_t st3b_mod = 1; + +void arpeggio(int32_t n1, int32_t n2, int32_t n3, int32_t len) { + #define MAGIC_FAC 2 + for (uint16_t i = 0; i < 5*len*len; i++) + { + #define ALEX 1 + #if ALEX + SetFreq(st1_mod*n1*(1+(i/128)), // Stimme 1 + st2_mod*n2*(1+(i/96)), // Stimme 2 + n3 * (1+(i / 32*st3b_mod)), // Basline + 80); // Lautstärke + #else + SetFreq(MAGIC_FAC*n1, // Stimme 1 + MAGIC_FAC*n2,// Stimme 2 + n3, // Basline + 80); // Lautstärke + #endif + _delay_us(600*st3_mod); + } +} + + + +void loop() +{ + for(;;) { + st1_mod = random(1,3); + st2_mod = random(1,3); + st3_mod = random(1,4); + st3b_mod = random(1,4); + + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(261,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(293,246,146,6); + arpeggio(246,196,99,7); + arpeggio(261,220,99,4); + arpeggio(293,246,99,6); + arpeggio(246,196,99,6); + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(262,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(246,196,99,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + } +} + + diff --git a/projekte/soundz/alex_sound1/sound_alex2_nochmal_repimped/sound_alex2_nochmal_repimped.pde b/projekte/soundz/alex_sound1/sound_alex2_nochmal_repimped/sound_alex2_nochmal_repimped.pde new file mode 100644 index 0000000..9050692 --- /dev/null +++ b/projekte/soundz/alex_sound1/sound_alex2_nochmal_repimped/sound_alex2_nochmal_repimped.pde @@ -0,0 +1,228 @@ +/* + * Theremin - Arduino Physical Computing für Bastler, Designer & Geeks + * + * Soundcode von: Michael Smith - http://www.arduino.cc/playground/Code/PCMAudio + * CapSense: http://www.arduino.cc/playground/Main/CapSense + * + * Alex Wenger 2009 + */ +#include +#include +#include +#include +#include + +// Audioausgabe +#define SAMPLE_RATE 8000 + +// Auf welchem PIN soll Audio ausgegeben werden? (nicht Ändern!!!) +int speakerPin = 11; + +const unsigned char sintab[] PROGMEM = { + 0x01,0x01,0x01,0x01,0x02,0x03,0x05,0x07, + 0x09,0x0c,0x0f,0x12,0x15,0x19,0x1c,0x21, + 0x25,0x29,0x2e,0x33,0x38,0x3d,0x43,0x48, + 0x4e,0x54,0x5a,0x60,0x66,0x6c,0x73,0x79, + 0x7f,0x85,0x8b,0x92,0x98,0x9e,0xa4,0xaa, + 0xb0,0xb6,0xbb,0xc1,0xc6,0xcb,0xd0,0xd5, + 0xd9,0xdd,0xe2,0xe5,0xe9,0xec,0xef,0xf2, + 0xf5,0xf7,0xf9,0xfb,0xfc,0xfd,0xfe,0xfe, + 0xfe,0xfe,0xfe,0xfd,0xfc,0xfb,0xf9,0xf7, + 0xf5,0xf2,0xef,0xec,0xe9,0xe5,0xe2,0xdd, + 0xd9,0xd5,0xd0,0xcb,0xc6,0xc1,0xbb,0xb6, + 0xb0,0xaa,0xa4,0x9e,0x98,0x92,0x8b,0x85, + 0x7f,0x79,0x73,0x6c,0x66,0x60,0x5a,0x54, + 0x4e,0x48,0x43,0x3d,0x38,0x33,0x2e,0x29, + 0x25,0x21,0x1c,0x19,0x15,0x12,0x0f,0x0c, + 0x09,0x07,0x05,0x03,0x02,0x01,0x01,0x01 +}; + + +volatile uint16_t sample1; // welches ist das nächste Sample aus der Sinustabelle +// die oberen 7 bit zeigen in die Tabelle, die restlichen +// bits sind kommastellen +volatile uint16_t sample2; +volatile uint16_t sample3; + +uint16_t vol; // aktuelle Lautstärke +volatile uint16_t set_vol; // gewuenschte Lautstärke +volatile uint16_t tone1; // Tonhöhe in "Inkrementiereinheiten" +volatile uint16_t tone2; // Tonhöhe in "Inkrementiereinheiten" +volatile uint16_t tone3; // Tonhöhe in "Inkrementiereinheiten" + + +// Interruptroutine, diese wird 8000 mal pro Sekunde aufgerufen und berechnet den nächsten +// Wert für die Tonausgabe +ISR(TIMER1_COMPA_vect) { + static int timer1counter; // Zähler um Lautstärkeänderung langsamer zu machen + int wert; + + // Wert an der Stelle sample1/512 aus der sinus-Tabelle lesen +/* wert = pgm_read_byte(&sintab[(sample1 >> 9)])+ + pgm_read_byte(&sintab[(sample2 >> 9)])+ + pgm_read_byte(&sintab[(sample3 >> 9)]); */ + + wert = pgm_read_byte(&sintab[(sample1 >> 9)])+ + pgm_read_byte(&sintab[(sample2 >> 9)])+ + (sample3 >> 8); + // Wert mit der aktuellen Lautstärke multiplizieren + wert = (wert * vol) / 256; + // PWM Hardware anweisen ab jetzt diesen Wert auszugeben + OCR2A = wert; + + // nächstes Sample in der Sinustabelle abhängig vom gewünschten + // Ton auswählen. + sample1 += tone1; + sample2 += tone2; + sample3 += tone3; + + // Lautstärke anpassen wen gewünscht (nur alle 50 Interrupts, damit + // es schön langsam passiert. + timer1counter++; + if (timer1counter > 50) + { + timer1counter = 0; + if (vol < set_vol) vol++; + if (vol > set_vol) vol--; + } +} + +void startPlayback() +{ + pinMode(speakerPin, OUTPUT); + + // Initialisiere den Timer 2 für die schnelle PWM zur + // Soundausgabe auf Pin 11 + + // Verwende den internen Takt (Datenblatt Seite 160) + ASSR &= ~(_BV(EXCLK) | _BV(AS2)); + + // Fast PWM mode (Seite 157) + TCCR2A |= _BV(WGM21) | _BV(WGM20); + TCCR2B &= ~_BV(WGM22); + + // Wähle die nicht invertierende PWM für pin OC2A und OC2B + // Am Arduino ist das Pin 11 und 3 + TCCR2A = (TCCR2A | _BV(COM2A1) | _BV(COM2B1)); + + // Keine Vorteiler / wir wollen es schnell! (Seite 158) + TCCR2B = (TCCR2B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Start Wert = 0, sonst gibt es ein hässliches Ploppgeräusch + OCR2A = 0; + OCR2B = 0; + + // Initialisiere Timer 1 für 8000 Interrupts/Sekunde + cli(); + + // Set CTC mode (Clear Timer on Compare Match) (Seite 133) + TCCR1B = (TCCR1B & ~_BV(WGM13)) | _BV(WGM12); + TCCR1A = TCCR1A & ~(_BV(WGM11) | _BV(WGM10)); + + // Kein Vorteiler (Seite 134) + TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Gewünschte Frequenz = 8000kHz + OCR1A = F_CPU / SAMPLE_RATE; // 16e6 / 8000 = 2000 + + // Aktiviere den Interrupt für TCNT1 == OCR1A (Seite 136) + TIMSK1 |= _BV(OCIE1A); + + // Startwerte + sample1 = 0; + sample2 = 0; + sample3 = 0; + + // Global Interrupts wieder einschalten. + sei(); +} + +// Aendert Ton und Lautstärke +// ton (50-4000Hz) +// volume (0-256); +void SetFreq(int ton1,int ton2, int ton3, int volume) +{ + tone1 = (128ul*512ul*ton1)/8000; + tone2 = (128ul*512ul*ton2)/8000; + tone3 = (128ul*512ul*ton3)/8000; + set_vol = volume; +} + +void setup() +{ + startPlayback(); +} + +uint8_t st1_mod = 1; +uint8_t st2_mod = 1; +uint8_t st3_mod = 1; +uint8_t st3b_mod = 1; + +void arpeggio(int32_t n1, int32_t n2, int32_t n3, int32_t len) { + #define MAGIC_FAC 2 + for (uint16_t i = 0; i < 5*len*len; i++) + { + SetFreq(MAGIC_FAC*n1, // Stimme 1 + MAGIC_FAC*n2,// Stimme 2 + n3, // Basline + 80); // Lautstärke + _delay_us(600*st3_mod); + } +} + + + +void loop() +{ + st1_mod = random(1,3); + st2_mod = random(1,3); + //st3_mod = random(1,4); + st3_mod = 2; + st3b_mod = random(1,4); + + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(261,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(293,246,146,6); + arpeggio(246,196,99,7); + arpeggio(261,220,99,4); + arpeggio(293,246,99,6); + arpeggio(246,196,99,6); + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(262,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(246,196,99,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); +} diff --git a/projekte/soundz/alex_sound1_repimped/alex_sound1_repimped.pde b/projekte/soundz/alex_sound1_repimped/alex_sound1_repimped.pde new file mode 100644 index 0000000..090a80e --- /dev/null +++ b/projekte/soundz/alex_sound1_repimped/alex_sound1_repimped.pde @@ -0,0 +1,233 @@ +/* + * speaker_pcm + * + * Plays 8-bit PCM audio on pin 11 using pulse-width modulation (PWM). + * For Arduino with Atmega168 at 16 MHz. + * + * Uses two timers. The first changes the sample value 8000 times a second. + * The second holds pin 11 high for 0-255 ticks out of a 256-tick cycle, + * depending on sample value. The second timer repeats 62500 times per second + * (16000000 / 256), much faster than the playback rate (8000 Hz), so + * it almost sounds halfway decent, just really quiet on a PC speaker. + * + * Takes over Timer 1 (16-bit) for the 8000 Hz timer. This breaks PWM + * (analogWrite()) for Arduino pins 9 and 10. Takes Timer 2 (8-bit) + * for the pulse width modulation, breaking PWM for pins 11 & 3. + * + * References: + * http://www.uchobby.com/index.php/2007/11/11/arduino-sound-part-1/ + * http://www.atmel.com/dyn/resources/prod_documents/doc2542.pdf + * http://www.evilmadscientist.com/article.php/avrdac + * http://gonium.net/md/2006/12/27/i-will-think-before-i-code/ + * http://fly.cc.fer.hr/GDM/articles/sndmus/speaker2.html + * http://www.gamedev.net/reference/articles/article442.asp + * + * Michael Smith + */ + +#include +#include +#include +#include +#include + +#define SAMPLE_RATE 8000 + + + + +/* + * The audio data needs to be unsigned, 8-bit, 8000 Hz, and small enough + * to fit in flash. 10000-13000 samples is about the limit. + * + * sounddata.h should look like this: + * const int sounddata_length=10000; + * const unsigned char sounddata_data[] PROGMEM = { ..... }; + * + * You can use wav2c from GBA CSS: + * http://thieumsweb.free.fr/english/gbacss.html + * Then add "PROGMEM" in the right place. I hacked it up to dump the samples + * as unsigned rather than signed, but it shouldn't matter. + * + * http://musicthing.blogspot.com/2005/05/tiny-music-makers-pt-4-mac-startup.html + * mplayer -ao pcm macstartup.mp3 + * sox audiodump.wav -v 1.32 -c 1 -r 8000 -u -1 macstartup-8000.wav + * sox macstartup-8000.wav macstartup-cut.wav trim 0 10000s + * wav2c macstartup-cut.wav sounddata.h sounddata + * + * (starfox) nb. under sox 12.18 (distributed in CentOS 5), i needed to run + * the following command to convert my wav file to the appropriate format: + * sox audiodump.wav -c 1 -r 8000 -u -b macstartup-8000.wav + */ + +int ledPin = 13; +int speakerPin = 11; +volatile uint16_t sample1; +volatile uint16_t sample2; +byte lastSample; + +prog_uint8_t sintab[] = { + 0x01,0x01,0x01,0x01,0x02,0x03,0x05,0x07, + 0x09,0x0c,0x0f,0x12,0x15,0x19,0x1c,0x21, + 0x25,0x29,0x2e,0x33,0x38,0x3d,0x43,0x48, + 0x4e,0x54,0x5a,0x60,0x66,0x6c,0x73,0x79, + 0x7f,0x85,0x8b,0x92,0x98,0x9e,0xa4,0xaa, + 0xb0,0xb6,0xbb,0xc1,0xc6,0xcb,0xd0,0xd5, + 0xd9,0xdd,0xe2,0xe5,0xe9,0xec,0xef,0xf2, + 0xf5,0xf7,0xf9,0xfb,0xfc,0xfd,0xfe,0xfe, + 0xfe,0xfe,0xfe,0xfd,0xfc,0xfb,0xf9,0xf7, + 0xf5,0xf2,0xef,0xec,0xe9,0xe5,0xe2,0xdd, + 0xd9,0xd5,0xd0,0xcb,0xc6,0xc1,0xbb,0xb6, + 0xb0,0xaa,0xa4,0x9e,0x98,0x92,0x8b,0x85, + 0x7f,0x79,0x73,0x6c,0x66,0x60,0x5a,0x54, + 0x4e,0x48,0x43,0x3d,0x38,0x33,0x2e,0x29, + 0x25,0x21,0x1c,0x19,0x15,0x12,0x0f,0x0c, + 0x09,0x07,0x05,0x03,0x02,0x01,0x01,0x01 +}; + +volatile uint16_t tone1_h; +volatile uint16_t tone2_h; + +// This is called at 8000 Hz to load the next sample. +ISR(TIMER1_COMPA_vect) { + OCR2A = (pgm_read_byte(&sintab[sample1 / 512]) + + pgm_read_byte(&sintab[sample2 / 512])) / 2; + +// OCR2A = pgm_read_byte(&sintab[sample1 / 512]); + sample1 = (sample1 + tone1_h); + sample2 = (sample2 + tone2_h); +} + +void startPlayback() +{ + pinMode(speakerPin, OUTPUT); + + // Set up Timer 2 to do pulse width modulation on the speaker + // pin. + + // Use internal clock (datasheet p.160) + ASSR &= ~(_BV(EXCLK) | _BV(AS2)); + + // Set fast PWM mode (p.157) + TCCR2A |= _BV(WGM21) | _BV(WGM20); + TCCR2B &= ~_BV(WGM22); + + // Do non-inverting PWM on pin OC2A (p.155) + // On the Arduino this is pin 11. + TCCR2A = (TCCR2A | _BV(COM2A1)) & ~_BV(COM2A0); + TCCR2A &= ~(_BV(COM2B1) | _BV(COM2B0)); + + // No prescaler (p.158) + TCCR2B = (TCCR2B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Set initial pulse width to the first sample. + OCR2A = 0; + + + // Set up Timer 1 to send a sample every interrupt. + + cli(); + + // Set CTC mode (Clear Timer on Compare Match) (p.133) + // Have to set OCR1A *after*, otherwise it gets reset to 0! + TCCR1B = (TCCR1B & ~_BV(WGM13)) | _BV(WGM12); + TCCR1A = TCCR1A & ~(_BV(WGM11) | _BV(WGM10)); + + // No prescaler (p.134) + TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Set the compare register (OCR1A). + // OCR1A is a 16-bit register, so we have to do this with + // interrupts disabled to be safe. + OCR1A = F_CPU / SAMPLE_RATE; // 16e6 / 8000 = 2000 + + // Enable interrupt when TCNT1 == OCR1A (p.136) + TIMSK1 |= _BV(OCIE1A); + + + sei(); +} + +void stopPlayback() +{ + // Disable playback per-sample interrupt. + TIMSK1 &= ~_BV(OCIE1A); + + // Disable the per-sample timer completely. + TCCR1B &= ~_BV(CS10); + + // Disable the PWM timer. + TCCR2B &= ~_BV(CS10); + + digitalWrite(speakerPin, LOW); +} + +void setup() +{ + pinMode(ledPin, OUTPUT); + tone1_h = 10; + tone2_h = 10; + startPlayback(); +} + +void arpeggio(int32_t n1, int32_t n2, int32_t n3, int32_t len) { + tone1_h = 16000/n1; + tone2_h = 16000/n2; + _delay_ms(50*len); +} + +void loop() +{ + + for(;;) { + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(261,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(293,246,146,6); + arpeggio(246,196,99,7); + arpeggio(261,220,99,4); + arpeggio(293,246,99,6); + arpeggio(246,196,99,6); + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(262,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(246,196,99,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + _delay_ms(3000); + } + +} + + diff --git a/projekte/soundz/arpeggio/applet/HardwareSerial.cpp.o b/projekte/soundz/arpeggio/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..ff3e13c Binary files /dev/null and b/projekte/soundz/arpeggio/applet/HardwareSerial.cpp.o differ diff --git a/projekte/soundz/arpeggio/applet/Print.cpp.o b/projekte/soundz/arpeggio/applet/Print.cpp.o new file mode 100644 index 0000000..1820b34 Binary files /dev/null and b/projekte/soundz/arpeggio/applet/Print.cpp.o differ diff --git a/projekte/soundz/arpeggio/applet/WInterrupts.c.o b/projekte/soundz/arpeggio/applet/WInterrupts.c.o new file mode 100644 index 0000000..a93ecc3 Binary files /dev/null and b/projekte/soundz/arpeggio/applet/WInterrupts.c.o differ diff --git a/projekte/soundz/arpeggio/applet/WMath.cpp.o b/projekte/soundz/arpeggio/applet/WMath.cpp.o new file mode 100644 index 0000000..215570c Binary files /dev/null and b/projekte/soundz/arpeggio/applet/WMath.cpp.o differ diff --git a/projekte/soundz/arpeggio/applet/arpeggio.cpp b/projekte/soundz/arpeggio/applet/arpeggio.cpp new file mode 100644 index 0000000..df6d298 --- /dev/null +++ b/projekte/soundz/arpeggio/applet/arpeggio.cpp @@ -0,0 +1,134 @@ +#include +#include +#include + +// number of timer0 overflows/sec +#define INT_PER_SEC F_CPU/1/256 + +// Frequencies (in Hz) of notes +#define F_FSH_4 370 +#define F_A_4 440 +#define F_B_4 494 +#define F_E_4 330 +#define F_CSH_5 554 +#define F_D_5 587 +#define F_FSH_5 740 +#define F_CSH_4 277 +#define F_GSH_4 415 + +// number of timer0 overflows for notes +#define REST -1 // special case +#define FSH_4 INT_PER_SEC/F_FSH_4 +#define A_4 INT_PER_SEC/F_A_4 +#define B_4 INT_PER_SEC/F_B_4 +#define E_4 INT_PER_SEC/F_E_4 +#define CSH_5 INT_PER_SEC/F_CSH_5 +#define D_5 INT_PER_SEC/F_D_5 +#define FSH_5 INT_PER_SEC/F_FSH_5 +#define CSH_4 INT_PER_SEC/F_CSH_4 +#define GSH_4 INT_PER_SEC/F_GSH_4 + +#define SEMIQUAVER_TIME 60 // ms +#define BREATH_TIME 20 // ms + +#include "WProgram.h" +void play(int32_t note, uint32_t len); +void setup(); +void loop(); +volatile uint32_t intrs = 0; +volatile int32_t curNote = REST; + +// TIMER0 overflow +ISR(TIMER0_OVF_vect) +{ + if (curNote == REST) + intrs = 0; + else + { + intrs++; + if (intrs >= curNote) + { + PORTD ^= _BV(PD4); + intrs = 0; + } + } +} + + +void play(int32_t note, uint32_t len) +{ + int i; + curNote = note; + for (i = 0; i< len; i++) + _delay_ms(SEMIQUAVER_TIME); + curNote = REST; + _delay_ms(BREATH_TIME); +} + +void setup() { + /* setup clock divider. Timer0 overflows on counting to 256. + * 16Mhz / 1 (CS0=1) = 16000000 increments/sec. Overflows every 256. + */ + TCCR0B |= _BV(CS00); + + // enable overflow interrupts + TIMSK0 |= _BV(TOIE0); + + // PD4 as output + DDRD = _BV(PD4); + + TCNT0 = 0; + intrs = 0; + + curNote = REST; + + // enable interrupts + sei(); +} + + +void loop() { + // Axel F + play(FSH_4, 2); + play(REST, 2); + play(A_4, 3); + play(FSH_4, 2); + play(FSH_4, 1); + play(B_4, 2); + play(FSH_4, 2); + play(E_4, 2); + play(FSH_4, 2); + play(REST, 2); + play(CSH_5, 3); + play(FSH_4, 2); + play(FSH_4, 1); + play(D_5, 2); + play(CSH_5, 2); + play(A_4, 2); + play(FSH_4, 2); + play(CSH_5, 2); + play(FSH_5, 2); + play(FSH_4, 1); + play(E_4, 2); + play(E_4, 1); + play(CSH_4, 2); + play(GSH_4, 2); + play(FSH_4, 6); + play(REST, 12); + + delay(3000); + +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/projekte/soundz/arpeggio/applet/arpeggio.cpp.o b/projekte/soundz/arpeggio/applet/arpeggio.cpp.o new file mode 100644 index 0000000..1a68d99 Binary files /dev/null and b/projekte/soundz/arpeggio/applet/arpeggio.cpp.o differ diff --git a/projekte/soundz/arpeggio/applet/core.a b/projekte/soundz/arpeggio/applet/core.a new file mode 100644 index 0000000..7ef6323 Binary files /dev/null and b/projekte/soundz/arpeggio/applet/core.a differ diff --git a/projekte/soundz/arpeggio/applet/pins_arduino.c.o b/projekte/soundz/arpeggio/applet/pins_arduino.c.o new file mode 100644 index 0000000..f6f0bed Binary files /dev/null and b/projekte/soundz/arpeggio/applet/pins_arduino.c.o differ diff --git a/projekte/soundz/arpeggio/applet/wiring.c.o b/projekte/soundz/arpeggio/applet/wiring.c.o new file mode 100644 index 0000000..c39c7f3 Binary files /dev/null and b/projekte/soundz/arpeggio/applet/wiring.c.o differ diff --git a/projekte/soundz/arpeggio/applet/wiring_analog.c.o b/projekte/soundz/arpeggio/applet/wiring_analog.c.o new file mode 100644 index 0000000..0ab6564 Binary files /dev/null and b/projekte/soundz/arpeggio/applet/wiring_analog.c.o differ diff --git a/projekte/soundz/arpeggio/applet/wiring_digital.c.o b/projekte/soundz/arpeggio/applet/wiring_digital.c.o new file mode 100644 index 0000000..a769214 Binary files /dev/null and b/projekte/soundz/arpeggio/applet/wiring_digital.c.o differ diff --git a/projekte/soundz/arpeggio/applet/wiring_pulse.c.o b/projekte/soundz/arpeggio/applet/wiring_pulse.c.o new file mode 100644 index 0000000..eeff05e Binary files /dev/null and b/projekte/soundz/arpeggio/applet/wiring_pulse.c.o differ diff --git a/projekte/soundz/arpeggio/applet/wiring_shift.c.o b/projekte/soundz/arpeggio/applet/wiring_shift.c.o new file mode 100644 index 0000000..1428c70 Binary files /dev/null and b/projekte/soundz/arpeggio/applet/wiring_shift.c.o differ diff --git a/projekte/soundz/arpeggio/arpeggio.pde b/projekte/soundz/arpeggio/arpeggio.pde new file mode 100644 index 0000000..6c2fc64 --- /dev/null +++ b/projekte/soundz/arpeggio/arpeggio.pde @@ -0,0 +1,184 @@ +#include +#include +#include + +#define REST -1 + +// number of timer0 overflows/sec +#define INT_PER_SEC F_CPU/1/256 + +volatile uint32_t intrs = 0; +volatile int32_t curNote = REST; + +// TIMER0 overflow +ISR(TIMER0_OVF_vect) { + if (curNote == REST) { + intrs = 0; + } else { + intrs++; + if (intrs >= curNote) { + PORTD ^= _BV(PD4); + intrs = 0; + } + } +} + +void arpeggio_play(int32_t note, uint32_t len) { + // FIXME: curNote is in interrupts, note is in hertz... + curNote = INT_PER_SEC/note/2; + + // len is in PC clock ticks * 10 + // clock tick is 1s/18.2 == 54ms + #define MAGIC_CLOCK_TICK 54 + #define MAGIC_DELAY_FACTOR 400 // well, should be 1000 us?! + #define MAGIC_BREATH 50 + _delay_us(MAGIC_DELAY_FACTOR*(len*MAGIC_CLOCK_TICK/10)); + + // breath + curNote=REST; + _delay_us(50); +} + + +void arpeggio(int32_t n1, int32_t n2, int32_t n3, int32_t len) { + for (int32_t i = 0; i < len; i++) { + arpeggio_play(n1, len); + arpeggio_play(n2, len); + arpeggio_play(n3, len); + } +} + + +int main(void) { + /* setup clock divider. Timer0 overflows on counting to 256. + * 16Mhz / 1 (CS0=1) = 16000000 increments/sec. Overflows every 256. + */ + TCCR0B |= _BV(CS00); + + // enable overflow interrupts + TIMSK0 |= _BV(TOIE0); + + // PD4 as output + DDRD = _BV(PD4); + + TCNT0 = 0; + intrs = 0; + + curNote = REST; + + // enable interrupts + sei(); + + + for(;;) { + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(261,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(293,246,146,6); + arpeggio(246,196,99,7); + arpeggio(261,220,99,4); + arpeggio(293,246,99,6); + arpeggio(246,196,99,6); + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(262,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(246,196,99,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + + + } +} + + +/* + 10 REM ARPEGGIO BY JIM LEONARD 5/8/1984 + 15 WIDTH 80:SCREEN 0,0,0:KEY OFF + 20 READ N1,N2,N3,D:ON ERROR GOTO 10000 + 30 FOR I = 1 TO D + 40 SOUND N1,D*.1 + 50 SOUND N2,D*.1 + 60 SOUND N3,D*.1 + 70 NEXT + 80 GOTO 20 + 300 DATA 261,329,130,7 + 310 DATA 329,392,130,4 + 320 DATA 329,392,130,6 + 330 DATA 329,392,123,6 + 340 DATA 261,329,110,7 + 350 DATA 329,392,110,4 + 360 DATA 493,392,110,4 + 370 DATA 523,440,110,4 + 375 DATA 440,349,110,6 + 380 DATA 293,246,146,7 + 390 DATA 329,261,146,4 + 400 DATA 349,293,146,6 + 410 DATA 293,246,146,6 + 420 DATA 246,196,99,7 + 430 DATA 261,220,99,4 + 440 DATA 293,246,99,6 + 450 DATA 246,196,99,6 + 500 DATA 261,329,130,7:REM REPEAT (ALMOST) + 510 DATA 329,392,130,4 + 520 DATA 329,392,130,6 + 530 DATA 329,392,123,6 + 540 DATA 261,329,110,7 + 550 DATA 329,392,110,4 + 560 DATA 493,392,110,4 + 570 DATA 523,440,110,4 + 575 DATA 440,349,110,6 + 580 DATA 293,246,146,7 + 590 DATA 329,261,146,4 + 600 DATA 349,293,146,6 + 620 DATA 246,196,99,6 + 630 DATA 261,329,110,6 + 640 DATA 261,329,110,6 + 645 DATA 261,329,110,6 + 650 DATA 246,196,99,6 + 660 DATA 174,220,82,6 + 670 DATA 174,220,82,6 + 680 DATA 174,220,82,6 + 690 DATA 246,196,99,6 + 700 DATA 261,329,110,6 + 710 DATA 261,329,110,6 + 720 DATA 261,329,110,6 + 730 DATA 261,329,110,6 + 740 DATA 261,329,110,6 + 750 DATA 261,329,110,6 + 760 DATA 261,329,110,6 + 10000 LOCATE 24,1:END +*/ + + + diff --git a/projekte/soundz/axelf/applet/HardwareSerial.cpp.o b/projekte/soundz/axelf/applet/HardwareSerial.cpp.o new file mode 100644 index 0000000..ff3e13c Binary files /dev/null and b/projekte/soundz/axelf/applet/HardwareSerial.cpp.o differ diff --git a/projekte/soundz/axelf/applet/Print.cpp.o b/projekte/soundz/axelf/applet/Print.cpp.o new file mode 100644 index 0000000..1820b34 Binary files /dev/null and b/projekte/soundz/axelf/applet/Print.cpp.o differ diff --git a/projekte/soundz/axelf/applet/WInterrupts.c.o b/projekte/soundz/axelf/applet/WInterrupts.c.o new file mode 100644 index 0000000..a93ecc3 Binary files /dev/null and b/projekte/soundz/axelf/applet/WInterrupts.c.o differ diff --git a/projekte/soundz/axelf/applet/WMath.cpp.o b/projekte/soundz/axelf/applet/WMath.cpp.o new file mode 100644 index 0000000..215570c Binary files /dev/null and b/projekte/soundz/axelf/applet/WMath.cpp.o differ diff --git a/projekte/soundz/axelf/applet/axelf.cpp b/projekte/soundz/axelf/applet/axelf.cpp new file mode 100644 index 0000000..59b2fa8 --- /dev/null +++ b/projekte/soundz/axelf/applet/axelf.cpp @@ -0,0 +1,134 @@ +#include +#include +#include + +// number of timer0 overflows/sec +#define INT_PER_SEC F_CPU/1/256 + +// Frequencies (in Hz) of notes +#define F_FSH_4 370 +#define F_A_4 440 +#define F_B_4 494 +#define F_E_4 330 +#define F_CSH_5 554 +#define F_D_5 587 +#define F_FSH_5 740 +#define F_CSH_4 277 +#define F_GSH_4 415 + +// number of timer0 overflows for notes +#define REST -1 // special case +#define FSH_4 INT_PER_SEC/F_FSH_4 +#define A_4 INT_PER_SEC/F_A_4 +#define B_4 INT_PER_SEC/F_B_4 +#define E_4 INT_PER_SEC/F_E_4 +#define CSH_5 INT_PER_SEC/F_CSH_5 +#define D_5 INT_PER_SEC/F_D_5 +#define FSH_5 INT_PER_SEC/F_FSH_5 +#define CSH_4 INT_PER_SEC/F_CSH_4 +#define GSH_4 INT_PER_SEC/F_GSH_4 + +#define SEMIQUAVER_TIME 60 // ms +#define BREATH_TIME 20 // ms + +#include "WProgram.h" +void play(int32_t note, uint32_t len); +int main(void); +volatile uint32_t intrs = 0; +volatile int32_t curNote = REST; + +// TIMER0 overflow +ISR(TIMER0_OVF_vect) +{ + if (curNote == REST) + intrs = 0; + else + { + intrs++; + if (intrs >= curNote) + { + PORTD ^= _BV(PD4); + intrs = 0; + } + } +} + + +void play(int32_t note, uint32_t len) +{ + int i; + curNote = note; + for (i = 0; i< len; i++) + _delay_ms(SEMIQUAVER_TIME); + curNote = REST; + _delay_ms(BREATH_TIME); +} + +int main(void) +{ + /* setup clock divider. Timer0 overflows on counting to 256. + * 16Mhz / 1 (CS0=1) = 16000000 increments/sec. Overflows every 256. + */ + TCCR0B |= _BV(CS00); + + // enable overflow interrupts + TIMSK0 |= _BV(TOIE0); + + // PD4 as output + DDRD = _BV(PD4); + + TCNT0 = 0; + intrs = 0; + + curNote = REST; + + // enable interrupts + sei(); + + while (1) + { + // Axel F + play(FSH_4, 2); + play(REST, 2); + play(A_4, 3); + play(FSH_4, 2); + play(FSH_4, 1); + play(B_4, 2); + play(FSH_4, 2); + play(E_4, 2); + play(FSH_4, 2); + play(REST, 2); + play(CSH_5, 3); + play(FSH_4, 2); + play(FSH_4, 1); + play(D_5, 2); + play(CSH_5, 2); + play(A_4, 2); + play(FSH_4, 2); + play(CSH_5, 2); + play(FSH_5, 2); + play(FSH_4, 1); + play(E_4, 2); + play(E_4, 1); + play(CSH_4, 2); + play(GSH_4, 2); + play(FSH_4, 6); + play(REST, 12); + + } + delay(3000); +} + + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/projekte/soundz/axelf/applet/core.a b/projekte/soundz/axelf/applet/core.a new file mode 100644 index 0000000..4435d7d Binary files /dev/null and b/projekte/soundz/axelf/applet/core.a differ diff --git a/projekte/soundz/axelf/applet/pins_arduino.c.o b/projekte/soundz/axelf/applet/pins_arduino.c.o new file mode 100644 index 0000000..f6f0bed Binary files /dev/null and b/projekte/soundz/axelf/applet/pins_arduino.c.o differ diff --git a/projekte/soundz/axelf/applet/wiring.c.o b/projekte/soundz/axelf/applet/wiring.c.o new file mode 100644 index 0000000..c39c7f3 Binary files /dev/null and b/projekte/soundz/axelf/applet/wiring.c.o differ diff --git a/projekte/soundz/axelf/applet/wiring_analog.c.o b/projekte/soundz/axelf/applet/wiring_analog.c.o new file mode 100644 index 0000000..0ab6564 Binary files /dev/null and b/projekte/soundz/axelf/applet/wiring_analog.c.o differ diff --git a/projekte/soundz/axelf/applet/wiring_digital.c.o b/projekte/soundz/axelf/applet/wiring_digital.c.o new file mode 100644 index 0000000..a769214 Binary files /dev/null and b/projekte/soundz/axelf/applet/wiring_digital.c.o differ diff --git a/projekte/soundz/axelf/applet/wiring_pulse.c.o b/projekte/soundz/axelf/applet/wiring_pulse.c.o new file mode 100644 index 0000000..eeff05e Binary files /dev/null and b/projekte/soundz/axelf/applet/wiring_pulse.c.o differ diff --git a/projekte/soundz/axelf/applet/wiring_shift.c.o b/projekte/soundz/axelf/applet/wiring_shift.c.o new file mode 100644 index 0000000..1428c70 Binary files /dev/null and b/projekte/soundz/axelf/applet/wiring_shift.c.o differ diff --git a/projekte/soundz/axelf/axelf.pde b/projekte/soundz/axelf/axelf.pde new file mode 100644 index 0000000..a5ec1c5 --- /dev/null +++ b/projekte/soundz/axelf/axelf.pde @@ -0,0 +1,119 @@ +#include +#include +#include + +// number of timer0 overflows/sec +#define INT_PER_SEC F_CPU/1/256 + +// Frequencies (in Hz) of notes +#define F_FSH_4 370 +#define F_A_4 440 +#define F_B_4 494 +#define F_E_4 330 +#define F_CSH_5 554 +#define F_D_5 587 +#define F_FSH_5 740 +#define F_CSH_4 277 +#define F_GSH_4 415 + +// number of timer0 overflows for notes +#define REST -1 // special case +#define FSH_4 INT_PER_SEC/F_FSH_4 +#define A_4 INT_PER_SEC/F_A_4 +#define B_4 INT_PER_SEC/F_B_4 +#define E_4 INT_PER_SEC/F_E_4 +#define CSH_5 INT_PER_SEC/F_CSH_5 +#define D_5 INT_PER_SEC/F_D_5 +#define FSH_5 INT_PER_SEC/F_FSH_5 +#define CSH_4 INT_PER_SEC/F_CSH_4 +#define GSH_4 INT_PER_SEC/F_GSH_4 + +#define SEMIQUAVER_TIME 60 // ms +#define BREATH_TIME 20 // ms + +volatile uint32_t intrs = 0; +volatile int32_t curNote = REST; + +// TIMER0 overflow +ISR(TIMER0_OVF_vect) +{ + if (curNote == REST) + intrs = 0; + else + { + intrs++; + if (intrs >= curNote) + { + PORTD ^= _BV(PD4); + intrs = 0; + } + } +} + + +void play(int32_t note, uint32_t len) +{ + int i; + curNote = note; + for (i = 0; i< len; i++) + _delay_ms(SEMIQUAVER_TIME); + curNote = REST; + _delay_ms(BREATH_TIME); +} + +int main(void) +{ + /* setup clock divider. Timer0 overflows on counting to 256. + * 16Mhz / 1 (CS0=1) = 16000000 increments/sec. Overflows every 256. + */ + TCCR0B |= _BV(CS00); + + // enable overflow interrupts + TIMSK0 |= _BV(TOIE0); + + // PD4 as output + DDRD = _BV(PD4); + + TCNT0 = 0; + intrs = 0; + + curNote = REST; + + // enable interrupts + sei(); + + while (1) + { + // Axel F + play(FSH_4, 2); + play(REST, 2); + play(A_4, 3); + play(FSH_4, 2); + play(FSH_4, 1); + play(B_4, 2); + play(FSH_4, 2); + play(E_4, 2); + play(FSH_4, 2); + play(REST, 2); + play(CSH_5, 3); + play(FSH_4, 2); + play(FSH_4, 1); + play(D_5, 2); + play(CSH_5, 2); + play(A_4, 2); + play(FSH_4, 2); + play(CSH_5, 2); + play(FSH_5, 2); + play(FSH_4, 1); + play(E_4, 2); + play(E_4, 1); + play(CSH_4, 2); + play(GSH_4, 2); + play(FSH_4, 6); + play(REST, 12); + + } + delay(3000); +} + + diff --git a/projekte/soundz/karplus_strong_totally_borken/karplus_strong_totally_borken.pde b/projekte/soundz/karplus_strong_totally_borken/karplus_strong_totally_borken.pde new file mode 100644 index 0000000..9df36f3 --- /dev/null +++ b/projekte/soundz/karplus_strong_totally_borken/karplus_strong_totally_borken.pde @@ -0,0 +1,104 @@ +#include "avr/delay.h" + +void setup() { + pinMode(11, OUTPUT); + + // Set up Timer 2 to do pulse width modulation on the speaker + // pin. + + // Use internal clock (datasheet p.160) + ASSR &= ~(_BV(EXCLK) | _BV(AS2)); + + // Set fast PWM mode (p.157) + TCCR2A |= _BV(WGM21) | _BV(WGM20); + TCCR2B &= ~_BV(WGM22); + + // Do non-inverting PWM on pin OC2A (p.155) + // On the Arduino this is pin 11. + TCCR2A = (TCCR2A | _BV(COM2A1)) & ~_BV(COM2A0); + TCCR2A &= ~(_BV(COM2B1) | _BV(COM2B0)); + + // No prescaler (p.158) + TCCR2B = (TCCR2B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Set initial pulse width to the first sample. + OCR2A = 0; +} + + +int play (uint16_t f, uint8_t T) { + sendKarplusStrongSound(f, T); +} + + +// http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1249193795 +int sendKarplusStrongSound(const uint16_t f /*Hz*/, const uint8_t T /*sec*/) { + const uint8_t N = 32; + const uint32_t sr = f * N; // sample rate: 800(25Hz)..47619(1488Hz) + + int16_t buf[N]; + for (uint8_t i=0; i0; i--) { + const int8_t v = (int8_t) (buf[bh] >> 8); + + OCR2A = v; + _delay_us(dt); // or do something else for
usecs + + uint8_t nbh = bh!=N-1 ? bh+1 : 0; + int32_t avg = buf[bh] + (int32_t)buf[nbh]; + //avg = (avg << 10) - avg; // subtract avg more than once to get faster volume decrease + avg = (avg << 10) - avg -avg; + buf[bh] = avg >> 11; // no division, just shift + bh = nbh; + } +} + +// Frequencies (in Hz) of notes +#define FSH_4 370 +#define A_4 440 +#define B_4 494 +#define E_4 330 +#define CSH_5 554 +#define D_5 587 +#define FSH_5 740 +#define CSH_4 277 +#define GSH_4 415 + +#define REST 0 + +void loop() { + // Axel F + play(FSH_4, 2); + play(REST, 2); + play(A_4, 3); + play(FSH_4, 2); + play(FSH_4, 1); + play(B_4, 2); + play(FSH_4, 2); + play(E_4, 2); + play(FSH_4, 2); + play(REST, 2); + play(CSH_5, 3); + play(FSH_4, 2); + play(FSH_4, 1); + play(D_5, 2); + play(CSH_5, 2); + play(A_4, 2); + play(FSH_4, 2); + play(CSH_5, 2); + play(FSH_5, 2); + play(FSH_4, 1); + play(E_4, 2); + play(E_4, 1); + play(CSH_4, 2); + play(GSH_4, 2); + play(FSH_4, 6); + play(REST, 12); + delay(100); +} diff --git a/projekte/soundz/pc-speaker-arpeggio.au b/projekte/soundz/pc-speaker-arpeggio.au new file mode 100644 index 0000000..c99d3d2 Binary files /dev/null and b/projekte/soundz/pc-speaker-arpeggio.au differ diff --git a/projekte/soundz/sound_alex2/sound_alex2.pde b/projekte/soundz/sound_alex2/sound_alex2.pde new file mode 100644 index 0000000..3353949 --- /dev/null +++ b/projekte/soundz/sound_alex2/sound_alex2.pde @@ -0,0 +1,210 @@ +/* +* Theremin - Arduino Physical Computing für Bastler, Designer & Geeks + * + * Soundcode von: Michael Smith - http://www.arduino.cc/playground/Code/PCMAudio + * CapSense: http://www.arduino.cc/playground/Main/CapSense + * + * Alex Wenger 2009 + */ +#include +#include +#include +#include +#include + +// Audioausgabe +#define SAMPLE_RATE 8000 + +// Auf welchem PIN soll Audio ausgegeben werden? (nicht Ändern!!!) +int speakerPin = 11; + +const unsigned char sintab[] PROGMEM = { + 0x01,0x01,0x01,0x01,0x02,0x03,0x05,0x07, + 0x09,0x0c,0x0f,0x12,0x15,0x19,0x1c,0x21, + 0x25,0x29,0x2e,0x33,0x38,0x3d,0x43,0x48, + 0x4e,0x54,0x5a,0x60,0x66,0x6c,0x73,0x79, + 0x7f,0x85,0x8b,0x92,0x98,0x9e,0xa4,0xaa, + 0xb0,0xb6,0xbb,0xc1,0xc6,0xcb,0xd0,0xd5, + 0xd9,0xdd,0xe2,0xe5,0xe9,0xec,0xef,0xf2, + 0xf5,0xf7,0xf9,0xfb,0xfc,0xfd,0xfe,0xfe, + 0xfe,0xfe,0xfe,0xfd,0xfc,0xfb,0xf9,0xf7, + 0xf5,0xf2,0xef,0xec,0xe9,0xe5,0xe2,0xdd, + 0xd9,0xd5,0xd0,0xcb,0xc6,0xc1,0xbb,0xb6, + 0xb0,0xaa,0xa4,0x9e,0x98,0x92,0x8b,0x85, + 0x7f,0x79,0x73,0x6c,0x66,0x60,0x5a,0x54, + 0x4e,0x48,0x43,0x3d,0x38,0x33,0x2e,0x29, + 0x25,0x21,0x1c,0x19,0x15,0x12,0x0f,0x0c, + 0x09,0x07,0x05,0x03,0x02,0x01,0x01,0x01 +}; + + +volatile uint16_t sample1; // welches ist das nächste Sample aus der Sinustabelle +// die oberen 7 bit zeigen in die Tabelle, die restlichen +// bits sind kommastellen +volatile uint16_t sample2; +volatile uint16_t sample3; + +uint16_t vol; // aktuelle Lautstärke +volatile uint16_t set_vol; // gewuenschte Lautstärke +volatile uint16_t tone1; // Tonhöhe in "Inkrementiereinheiten" +volatile uint16_t tone2; // Tonhöhe in "Inkrementiereinheiten" +volatile uint16_t tone3; // Tonhöhe in "Inkrementiereinheiten" + + +// Interruptroutine, diese wird 8000 mal pro Sekunde aufgerufen und berechnet den nächsten +// Wert für die Tonausgabe +ISR(TIMER1_COMPA_vect) { + static int timer1counter; // Zähler um Lautstärkeänderung langsamer zu machen + int wert; + + // Wert an der Stelle sample1/512 aus der sinus-Tabelle lesen + wert = pgm_read_byte(&sintab[(sample1 >> 9)])+ + pgm_read_byte(&sintab[(sample2 >> 9)])+ + pgm_read_byte(&sintab[(sample3 >> 9)]); + // Wert mit der aktuellen Lautstärke multiplizieren + wert = (wert * vol) / 256; + // PWM Hardware anweisen ab jetzt diesen Wert auszugeben + OCR2A = wert; + + // nächstes Sample in der Sinustabelle abhängig vom gewünschten + // Ton auswählen. + sample1 += tone1; + sample2 += tone2; + sample3 += tone3; + + // Lautstärke anpassen wen gewünscht (nur alle 50 Interrupts, damit + // es schön langsam passiert. + timer1counter++; + if (timer1counter > 50) + { + timer1counter = 0; + if (vol < set_vol) vol++; + if (vol > set_vol) vol--; + } +} + +void startPlayback() +{ + pinMode(speakerPin, OUTPUT); + + // Initialisiere den Timer 2 für die schnelle PWM zur + // Soundausgabe auf Pin 11 + + // Verwende den internen Takt (Datenblatt Seite 160) + ASSR &= ~(_BV(EXCLK) | _BV(AS2)); + + // Fast PWM mode (Seite 157) + TCCR2A |= _BV(WGM21) | _BV(WGM20); + TCCR2B &= ~_BV(WGM22); + + // Wähle die nicht invertierende PWM für pin OC2A und OC2B + // Am Arduino ist das Pin 11 und 3 + TCCR2A = (TCCR2A | _BV(COM2A1) | _BV(COM2B1)); + + // Keine Vorteiler / wir wollen es schnell! (Seite 158) + TCCR2B = (TCCR2B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Start Wert = 0, sonst gibt es ein hässliches Ploppgeräusch + OCR2A = 0; + OCR2B = 0; + + // Initialisiere Timer 1 für 8000 Interrupts/Sekunde + cli(); + + // Set CTC mode (Clear Timer on Compare Match) (Seite 133) + TCCR1B = (TCCR1B & ~_BV(WGM13)) | _BV(WGM12); + TCCR1A = TCCR1A & ~(_BV(WGM11) | _BV(WGM10)); + + // Kein Vorteiler (Seite 134) + TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11))) | _BV(CS10); + + // Gewünschte Frequenz = 8000kHz + OCR1A = F_CPU / SAMPLE_RATE; // 16e6 / 8000 = 2000 + + // Aktiviere den Interrupt für TCNT1 == OCR1A (Seite 136) + TIMSK1 |= _BV(OCIE1A); + + // Startwerte + sample1 = 0; + sample2 = 0; + sample3 = 0; + + // Global Interrupts wieder einschalten. + sei(); +} + +// Aendert Ton und Lautstärke +// ton (50-4000Hz) +// volume (0-256); +void SetFreq(int ton1,int ton2, int ton3, int volume) +{ + tone1 = (128ul*512ul*ton1)/8000; + tone2 = (128ul*512ul*ton2)/8000; + tone3 = (128ul*512ul*ton3)/8000; + set_vol = volume; +} + +void setup() +{ + startPlayback(); +} + + +void arpeggio(int32_t n1, int32_t n2, int32_t n3, int32_t len) { + #define MAGIC_FAC 2 + SetFreq(MAGIC_FAC*n1,MAGIC_FAC*n2,n3,80); + _delay_ms(5*len*len); +} + +void loop() +{ + for(;;) { + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(261,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(293,246,146,6); + arpeggio(246,196,99,7); + arpeggio(261,220,99,4); + arpeggio(293,246,99,6); + arpeggio(246,196,99,6); + arpeggio(261,329,130,7); + arpeggio(329,392,130,4); + arpeggio(329,392,130,6); + arpeggio(329,392,123,6); + arpeggio(262,329,110,7); + arpeggio(329,392,110,4); + arpeggio(493,392,110,4); + arpeggio(523,440,110,4); + arpeggio(440,349,110,6); + arpeggio(293,246,146,7); + arpeggio(329,261,146,4); + arpeggio(349,293,146,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(246,196,99,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(174,220,82,6); + arpeggio(246,196,99,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + arpeggio(261,329,110,6); + } +} + +