├── .gitignore ├── README.md ├── de ├── Arduino │ └── Fritzing Creator Kit │ │ ├── Blink │ │ └── Blink.ino │ │ ├── Fading │ │ └── Fading.ino │ │ ├── FlipFlop │ │ └── FlipFlop.ino │ │ ├── Lauflicht │ │ └── Lauflicht.ino │ │ ├── Lichtautomatik │ │ └── Lichtautomatik.ino │ │ ├── Matrix │ │ └── Matrix.ino │ │ ├── Motor │ │ └── Motor.ino │ │ ├── Nachtlicht │ │ └── Nachtlicht.ino │ │ ├── PingPong │ │ └── PingPong.ino │ │ ├── Potentiometer │ │ └── Potentiometer.ino │ │ ├── Servo │ │ └── Servo.ino │ │ ├── Synthesizer │ │ └── Synthesizer.ino │ │ ├── Uebung1_1 │ │ └── Uebung1_1.ino │ │ ├── Uebung1_2a │ │ └── Uebung1_2a.ino │ │ ├── Uebung1_2b │ │ └── Uebung1_2b.ino │ │ ├── Uebung2_1 │ │ └── Uebung2_1.ino │ │ ├── Uebung3_1 │ │ └── Uebung3_1.ino │ │ ├── Uebung3_2 │ │ └── Uebung3_2.ino │ │ ├── Uebung4_1 │ │ └── Uebung4_1.ino │ │ ├── Uebung6_1 │ │ └── Uebung6_1.ino │ │ └── Wahrsager │ │ └── Wahrsager.ino ├── Fritzing │ ├── 555Keyfob.fzz │ ├── Blink.fzz │ ├── Fading.fzz │ ├── FlipFlop.fzz │ ├── H-Bridge.fzz │ ├── Lauflicht.fzz │ ├── Lichtautomatik.fzz │ ├── Matrix.fzz │ ├── Messen_Spannung.fzz │ ├── Nachtlicht.fzz │ ├── Orakelwürfel_01.fzz │ ├── Piezo_Synth_Sch.fzz │ ├── Ping-Pong.fzz │ ├── Pingpong.fzz │ ├── Potentiometer.fzz │ ├── Processing_RGB.fzz │ ├── Sandbox.fzz │ ├── SchematicsRref.fzz │ ├── Servo.fzz │ ├── Synthesizer.fzz │ ├── TwitterSaurus.fzz │ ├── Verstaerkung.fzz │ ├── Verstärkung.fzz │ ├── Wahrsager.fzz │ ├── Wahrsager222.fzz │ └── Zaubertafel.fzz └── Processing │ ├── RGB │ └── RGB.pde │ ├── TwitterSaurus │ ├── TwitterSaurus.pde │ ├── code │ │ └── twitter4j-core-3.0.3.jar │ └── data │ │ ├── OCRAStd-14.vlw │ │ └── sound1.wav │ ├── TwitterSaurus2 │ ├── TwitterSaurus2.pde │ └── code │ │ └── twitter4j-core-3.0.3.jar │ ├── Zaubertafel │ └── Zaubertafel.pde │ └── twitter4j-core-2.2.5.jar └── en ├── Arduino └── Fritzing Creator Kit │ ├── AutomaticLightingSystem │ └── AutomaticLightingSystem.ino │ ├── Blink │ └── Blink.ino │ ├── Chaserlights │ └── Chaserlights.ino │ ├── Exercise1_1 │ └── Exercise1_1.ino │ ├── Exercise1_2a │ └── Exercise1_2a.ino │ ├── Exercise1_2b │ └── Exercise1_2b.ino │ ├── Exercise2_1 │ └── Exercise2_1.ino │ ├── Exercise3_1 │ └── Exercise3_1.ino │ ├── Exercise3_2 │ └── Exercise3_2.ino │ ├── Exercise4_1 │ └── Exercise4_1.ino │ ├── Exercise6_1 │ └── Exercise6_1.ino │ ├── Fading │ └── Fading.ino │ ├── FlipFlop │ └── FlipFlop.ino │ ├── Fortuneteller │ └── Fortuneteller.ino │ ├── Matrix │ └── Matrix.ino │ ├── Motor │ └── Motor.ino │ ├── Nightlight │ └── Nightlight.ino │ ├── PingPong │ └── PingPong.ino │ ├── Potentiometer │ └── Potentiometer.ino │ ├── Servo │ └── Servo.ino │ └── Synthesizer │ └── Synthesizer.ino ├── Fritzing ├── 555Keyfob.fzz ├── Amplification.fzz ├── AutomaticLightingSystem.fzz ├── Automatic_Lighting_System.fzz ├── Blink.fzz ├── Chaser_Lights.fzz ├── Chaserlights.fzz ├── Fading.fzz ├── FlipFlop.fzz ├── Fortuneteller.fzz ├── Fortuneteller2.fzz ├── H-Bridge.fzz ├── Magic_Board.fzz ├── Matrix.fzz ├── Messen_Spannung.fzz ├── Night_Light.fzz ├── Nightlight.fzz ├── Orakelwürfel_01.fzz ├── Piezo_Synth_Sch.fzz ├── Ping-Pong.fzz ├── Ping_Pong.fzz ├── Pingpong.fzz ├── Potentiometer.fzz ├── Processing_RGB.fzz ├── Sandbox.fzz ├── SchematicsRref.fzz ├── Servo.fzz ├── Synthesizer.fzz ├── TwitterSaurus.fzz ├── Twitter_Saurus.fzz ├── Verstärkung.fzz └── Zaubertafel.fzz └── Processing ├── RGB └── RGB.pde ├── TwitterSaurus ├── TwitterSaurus.pde ├── code │ └── twitter4j-core-3.0.3.jar └── data │ ├── OCRAStd-14.vlw │ └── sound1.wav ├── TwitterSaurus2 ├── TwitterSaurus2.pde └── code │ └── twitter4j-core-3.0.3.jar ├── Zaubertafel └── Zaubertafel.pde └── twitter4j-core-2.2.5.jar /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.pyc 4 | *.com 5 | *.class 6 | *.dll 7 | *.exe 8 | *.o 9 | *.so 10 | 11 | # Temporary files # 12 | ############### 13 | *.py~ 14 | *.xml~ 15 | 16 | # OS generated files # 17 | ###################### 18 | *.DS_Store 19 | ._* 20 | .Spotlight-V100 21 | .Trashes 22 | ehthumbs.db 23 | Thumbs.db 24 | .bash_history 25 | saved_state 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Example Projects for the Fritzing Creator Kit 2 | ============================================= 3 | 4 | Contains all Fritzing sketches, Arduino code, and Processing code for the project examples of the Fritzing Creator Kit 5 | 6 | de - German/Deutsch 7 | 8 | en - English 9 | 10 | 11 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Blink/Blink.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Blink 3 | 4 | Schaltet eine LED im Rythmus von einer Sekunde an und aus 5 | 6 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 7 | */ 8 | 9 | int led = 13; // ganzzahlige Variable led wird deklariert 10 | 11 | void setup() { // die setup()-Methode wird einmal ausgeführt 12 | pinMode(led, OUTPUT); 13 | } 14 | 15 | void loop() { // die loop()-Methode wird immer wiederholt 16 | digitalWrite(led, HIGH); // schaltet die LED ein 17 | delay(1000); // hält das Programm für 1000 Millisekunden an 18 | digitalWrite(led, LOW); // schaltet die LED ab 19 | delay(1000); // hält das Programm für 1000 Millisekunden an 20 | } 21 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Fading/Fading.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Fading 3 | dimmt eine LED langsam an und aus 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int ledPin = 9; // ledPin wird deklariert 9 | 10 | void setup(){ 11 | // die analoge Ausgabe muss nicht im Setup initialisiert werden 12 | } 13 | 14 | void loop(){ 15 | for(int leuchtwert = 0; leuchtwert <= 255; leuchtwert++) { // fadeValue wird in Fünferschritten hochgezählt 16 | analogWrite(ledPin, leuchtwert); // und als analoger Wert an die LED übertragen 17 | delay(2); // kurze Wartezeit 18 | } 19 | for(int leuchtwert = 255; leuchtwert >= 0; leuchtwert--) { // fadeValue wird in Fünferschritten runtergezählt 20 | analogWrite(ledPin, leuchtwert); // und als analoger Wert an die LED übertragen 21 | delay(2); // kurze Wartezeit 22 | } 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/FlipFlop/FlipFlop.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Flip Flop 3 | schaltet mittels eines Tasters zwischen zwei LEDs hin und her 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int tasterPin=2; // Pin an dem der Taster angeschlossen ist 9 | int grueneLED=9; // Pin an dem die grüne LED angeschlossen ist 10 | int roteLED=10; // Pin an dem die rote LED angeschlossen ist 11 | 12 | void setup(){ 13 | pinMode(tasterPin, INPUT); // Taster Pin wird als INPUT initialisiert 14 | pinMode(grueneLED, OUTPUT); // LED Pin wird als OUTPUT initialisiert 15 | pinMode(roteLED, OUTPUT); // LED Pin wird als OUTPUT initialisiert 16 | } 17 | 18 | void loop(){ 19 | if (digitalRead(tasterPin)==LOW){ // wenn der Taster gedrückt ist (LOW) 20 | digitalWrite(grueneLED, HIGH); // grüne LED einschalten 21 | digitalWrite(roteLED, LOW); // rote LED abschalten 22 | } else { // sonst 23 | digitalWrite(grueneLED, LOW); // grüne LED abschalten 24 | digitalWrite(roteLED, HIGH); // rote LED einschalten 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Lauflicht/Lauflicht.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Lauflicht 3 | 4 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 5 | */ 6 | 7 | int pinsGesamt=8; // deklariert die ganzzahlige Variable pinsGesamt 8 | int pins[] = {2,3,4,5,6,7,8,9}; // deklariert das Array pins[] 9 | 10 | void setup() { 11 | for (int i=0; i0; i=i-1){ // Lauflicht Zurück (die äußeren LEDs werden nicht angesteuert) 23 | digitalWrite(pins[i], HIGH); // LED an der Stelle i einschalten 24 | delay(100); // hält das Programm für 100 Millisekunden an 25 | digitalWrite(pins[i], LOW); // LED an der Stelle i ausschalten 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Lichtautomatik/Lichtautomatik.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Lichtautomatik 3 | schaltet die Lichter eines Autos ja nach Helligkeit an und ab 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int lichtsensorPin = 0; // lichtsensorPin wird deklariert 9 | int scheinwerferPin = 2; // scheinwerferPin wird deklariert 10 | int schaltgrenze = 300; // ab diesem Wert wird »Dunkelheit« definiert 11 | int wartezeit = 1000; // Timer-Timeout sind 1000 Millisekunden 12 | long timer = 0; // Timervariabel wird deklariert 13 | int lichtwert; // speichert die Lichtsittuation 14 | 15 | void setup(){ 16 | Serial.begin(9600); // startet die serielle Kommunikation 17 | pinMode(scheinwerferPin,OUTPUT); // scheinwerferPin wird als OUTPUT initialisiert 18 | } 19 | 20 | void loop(){ 21 | lichtwert = analogRead(lichtsensorPin); // lichtwert wird eingelesen 22 | Serial.println(lichtwert); // lichtwert wird an die serielle Schnittstelle gesendet 23 | if (lichtwert>schaltgrenze){ // wenn die Schaltgrenze unterschritten wird 24 | timer=millis(); // timer wird auf aktuelle Zeit gesetzt 25 | digitalWrite(scheinwerferPin, HIGH); // Scheinwerfer werden eingeschalten 26 | } else if (millis()>wartezeit+timer){ // sonst wenn er Timer abgelaufen ist 27 | digitalWrite(scheinwerferPin, LOW); // werden die Scheinwerfer abgeschalten 28 | } 29 | delay(10); // Pause 30 | } 31 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Matrix/Matrix.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Matrix 3 | LED-Matrix zeigt ein Bild 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | // Pinbelegung für Arduino UNO 9 | int reihenPins[8] = {9,3,2,12,15,11,7,6}; // Anschlüsse der Reihenpins am Arduino 10 | int spaltenPins[8] = {13,8,17,10,5,16,4,14}; // Anschlüsse der Spaltenpins am Arduino 11 | 12 | 13 | // Pinbelegung für Arduino MEGA 14 | // int reihenPins[8] = {9,3,2,12,55,11,7,6}; // Anschlüsse der Reihenpins am Arduino 15 | // int spaltenPins[8] = {13,8,57,10,5,56,4,54}; // Anschlüsse der Spaltenpins am Arduino 16 | 17 | 18 | int image[8][8]={ // Bild, das auf der Matrix gezeigt wird. 1 = LED an, 0 = LED aus 19 | 20 | {0,1,0,0,0,0,1,0}, 21 | {1,1,1,0,0,1,1,1}, 22 | {0,1,0,0,0,0,1,0}, 23 | {0,0,0,1,1,0,0,0}, 24 | {0,0,0,1,1,0,0,0}, 25 | {1,0,0,0,0,0,0,1}, 26 | {0,1,1,1,1,1,1,0}, 27 | {0,0,1,1,1,1,0,0} 28 | 29 | }; 30 | 31 | void setup(){ 32 | for (int i=0; i<8; i++){ // Alle Pins werden als OUTPUT declariert 33 | pinMode(reihenPins[i],OUTPUT); 34 | pinMode(spaltenPins[i],OUTPUT); 35 | } 36 | } 37 | 38 | void loop(){ 39 | for (int y=0; y<8; y++){ // zeilenweise werden 40 | for (int x=0; x<8; x++){ // von links nach rechts alle Einträge des Arrays geprüft 41 | if (image[x][y]==1){ // ist der Eintrag = 1 42 | digitalWrite(spaltenPins[x],HIGH); // wird der Spaltenpin eingeschalten 43 | } else { // sonst 44 | digitalWrite(spaltenPins[x],LOW); // abgeschalten 45 | } 46 | } 47 | digitalWrite(reihenPins[y],LOW); // nun wird der Reihenpin auf LOW geschalten (da es die Kathode der LED betrifft bedeutet LOW eingeschalten: LOW = GND) 48 | delayMicroseconds(100); // das Programm hällt 100 Mikrosekunden an 49 | digitalWrite(reihenPins[y],HIGH); // danach wird der Reihenpin wieder auf HIGH (in diesem Fall also abge-) schalten 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Motor/Motor.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Motor 3 | dreht einen Motor erst rechts, dann links herum 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int motor_A=5; 9 | int motor_B=4; 10 | int motor_Speed=3; 11 | 12 | void setup(){ 13 | pinMode(motor_A,OUTPUT); 14 | pinMode(motor_B,OUTPUT); 15 | } 16 | 17 | void loop(){ 18 | digitalWrite(motor_A,HIGH); 19 | digitalWrite(motor_B,LOW); 20 | for (int i=0; i<256; i+=5){ 21 | analogWrite(motor_Speed,i); 22 | delay(20); 23 | } 24 | for (int i=255; i>0; i-=5){ 25 | analogWrite(motor_Speed,i); 26 | delay(20); 27 | } 28 | 29 | digitalWrite(motor_A,LOW); 30 | digitalWrite(motor_B,HIGH); 31 | for (int i=0; i<256; i+=5){ 32 | analogWrite(motor_Speed,i); 33 | delay(20); 34 | } 35 | for (int i=255; i>0; i-=5){ 36 | analogWrite(motor_Speed,i); 37 | delay(20); 38 | } 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Nachtlicht/Nachtlicht.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Nachtlicht 3 | blendet Farben durch 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int LEDGreen=9; // LEDGreen Pins wird deklariert 9 | int LEDBlue=10; // LEDBlue Pins wird deklariert 10 | int LEDRed=11; // LEDRed Pins wird deklariert 11 | 12 | void setup(){ 13 | pinMode(LEDRed,OUTPUT); // Pin wird als OUTPUT initialisiert 14 | pinMode(LEDGreen,OUTPUT); // Pin wird als OUTPUT initialisiert 15 | pinMode(LEDBlue,OUTPUT); // Pin wird als OUTPUT initialisiert 16 | } 17 | 18 | void loop(){ 19 | for (int frame=0; frame<900; frame++){ // frame wird von 0 bis 900 hochgezählt 20 | if (frame<150) { // wenn frame < 150 > rot 21 | analogWrite(LEDRed,255); // LED wird eingeschaltet 22 | analogWrite(LEDBlue,0); // LED wird abgeschaltet 23 | analogWrite(LEDGreen,0); // LED wird abgeschaltet 24 | } else if (frame<300) { // wenn frame < 300 25 | analogWrite(LEDRed,map(frame,150,300,255,0)); // LED wird ausgedimmt 26 | analogWrite(LEDBlue,map(frame,150,300,0,255)); // LED wird angedimmt 27 | analogWrite(LEDGreen,0); // LED wird abgeschaltet 28 | } else if (frame<450) { // wenn frame < 450 > blau 29 | analogWrite(LEDRed,0); // LED wird abgeschaltet 30 | analogWrite(LEDBlue,255); // LED wird eingeschaltet 31 | analogWrite(LEDGreen,0); // LED wird abgeschaltet 32 | } else if (frame<600) { // wenn frame < 600 33 | analogWrite(LEDRed,0); // LED wird abgeschaltet 34 | analogWrite(LEDBlue,map(frame,450,600,255,0)); // LED wird ausgedimmt 35 | analogWrite(LEDGreen,map(frame,450,600,0,255)); // LED wird angedimmt 36 | } else if (frame<750) { // wenn frame < 750 > grün 37 | analogWrite(LEDRed,0); // LED wird abgeschaltet 38 | analogWrite(LEDBlue,0); // LED wird abgeschaltet 39 | analogWrite(LEDGreen,255); // LED wird abgeschaltet 40 | } else if (frame<900) { // wenn frame < 900 41 | analogWrite(LEDRed,map(frame,750,900,0,255)); // LED wird angedimmt 42 | analogWrite(LEDBlue,0); // LED wird abgeschaltet 43 | analogWrite(LEDGreen,map(frame,750,900,255,0)); // LED wird ausgedimmt 44 | } 45 | delay(10); // kurze Pause 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/PingPong/PingPong.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Ping Pong Spiel 3 | LED-Matrix und zwei Potis für ein Pingpong Spiel 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | // Pinbelegung für Arduino UNO 9 | int reihenPins[8] = {9,3,2,12,15,11,7,6}; // Anschlüsse der Reihenpins am Arduino 10 | int spaltenPins[8] = {13,8,17,10,5,16,4,14}; // Anschlüsse der Spaltenpins am Arduino 11 | 12 | 13 | // Pinbelegung für Arduino MEGA 14 | // int reihenPins[8] = {9,3,2,12,55,11,7,6}; // Anschlüsse der Reihenpins am Arduino 15 | // int spaltenPins[8] = {13,8,57,10,5,56,4,54}; // Anschlüsse der Spaltenpins am Arduino 16 | 17 | int pot1Pin=4; // Pin an dem das Potentiometer von Spieler 1 angeschlossen ist 18 | int pot2Pin=5; // Pin an dem das Potentiometer von Spieler 2 angeschlossen ist 19 | 20 | int image[8][8]={ // Bild, das auf der Matrix gezeigt wird. 1 = LED an, 0 = LED aus 21 | {0,0,0,0,0,0,0,0}, 22 | {0,0,0,0,0,0,0,0}, 23 | {0,0,0,0,0,0,0,0}, 24 | {0,0,0,0,0,0,0,0}, 25 | {0,0,0,0,0,0,0,0}, 26 | {0,0,0,0,0,0,0,0}, 27 | {0,0,0,0,0,0,0,0}, 28 | {0,0,0,0,0,0,0,0} 29 | }; 30 | 31 | int death[8][8]={ // Alles an 32 | {1,1,1,1,1,1,1,1}, 33 | {1,1,1,1,1,1,1,1}, 34 | {1,1,1,1,1,1,1,1}, 35 | {1,1,1,1,1,1,1,1}, 36 | {1,1,1,1,1,1,1,1}, 37 | {1,1,1,1,1,1,1,1}, 38 | {1,1,1,1,1,1,1,1}, 39 | {1,1,1,1,1,1,1,1} 40 | }; 41 | 42 | int death2[8][8]={ // Totenkopf 43 | {0,1,1,1,1,1,0,0}, 44 | {1,1,1,1,1,1,1,0}, 45 | {1,0,0,1,0,0,1,0}, 46 | {1,1,1,1,1,1,1,0}, 47 | {0,1,1,1,1,1,0,0}, 48 | {0,1,0,1,0,1,0,0}, 49 | {0,1,0,1,0,1,0,0}, 50 | {0,0,0,0,0,0,0,0} 51 | }; 52 | 53 | int blank[8][8]={ // alles aus 54 | {0,0,0,0,0,0,0,0}, 55 | {0,0,0,0,0,0,0,0}, 56 | {0,0,0,0,0,0,0,0}, 57 | {0,0,0,0,0,0,0,0}, 58 | {0,0,0,0,0,0,0,0}, 59 | {0,0,0,0,0,0,0,0}, 60 | {0,0,0,0,0,0,0,0}, 61 | {0,0,0,0,0,0,0,0} 62 | }; 63 | 64 | long theTimer; // Timervariable 65 | 66 | int gameState=0; // speichert den Spielmodus 67 | int animations=300; // speichert die Dauer der Zwischenbilder 68 | 69 | float ballXSpeed = 1; // speichert die Beschleunigung in X-Richtung 70 | float ballXPosition=4; // speichert die Ballposition als reale Zahl 71 | 72 | float ballYSpeed = 0; // speichert die Beschleunigung in Y-Richtung 73 | float ballYPosition=4; // speichert die Ballposition als reale Zahl 74 | 75 | int imageYPosition; // speichert die Ballposition als ganze Zahl 76 | int imageXPosition; // speichert die Ballposition als ganze Zahl 77 | 78 | int player1Position=3; // speichert die Paddel Position von Player1 79 | int player2Position=3; // speichert die Paddel Position von Player2 80 | 81 | int gameSpeed; // speichert die aktuelle Spielgeschwindigkeit 82 | 83 | void setup(){ 84 | for (int i=0; i<8; i++){ // Alle Pins werden als OUTPUT deklariert 85 | pinMode(reihenPins[i],OUTPUT); 86 | pinMode(spaltenPins[i],OUTPUT); 87 | } 88 | } 89 | 90 | void draw(){ 91 | for (int y=0; y<8; y++){ // zeilenweise werden 92 | for (int x=0; x<8; x++){ // von links nach rechts alle Einträge des Arrays geprüft 93 | if (image[x][y]==1){ // ist der Eintrag = 1 94 | digitalWrite(spaltenPins[x],HIGH); // wird der Spaltenpin eingeschalten 95 | } else { // sonst 96 | digitalWrite(spaltenPins[x],LOW); // abgeschalten 97 | } 98 | } 99 | digitalWrite(reihenPins[y],LOW); // nun wird der Reihenpin auf LOW geschalten (da es die Kathode der LED betrifft bedeutet LOW eingeschalten: LOW = GND) 100 | delayMicroseconds(1000); // das Programm hällt 1000 Mikrosekunden an 101 | digitalWrite(reihenPins[y],HIGH); // danach wird der Reihenpin wieder auf HIGH (in diesem Fall also abge-) schalten 102 | } 103 | } 104 | 105 | void update(){ 106 | switch (gameState) { // in welchem Modus befindet sich das Programm 107 | case 0: // neues Spiel 108 | memcpy(image,blank,sizeof(blank)); // Bildschirm wird gelöscht 109 | gameSpeed=300; // Spieltempo wird festgelegt 110 | ballXPosition=3; // festlegen der Ballposition 111 | ballYPosition=3; // festlegen der Ballposition 112 | ballYSpeed=0; // Ball fliegt am Anfang gerade 113 | if (random(0,2)>0){ // per Zufall nach Links oder Rechts 114 | ballXSpeed=1; 115 | } else { 116 | ballXSpeed=-1; 117 | } 118 | theTimer=millis(); 119 | gameState=1; 120 | break; 121 | case 1: // Spiel aktiv 122 | image[player1Position][0]=0; // Paddel Player 1 alte Position löschen 123 | image[player1Position+1][0]=0; // Paddel Player 1 alte Position löschen 124 | image[player2Position][7]=0; // Paddel Player 2 alte Position löschen 125 | image[player2Position+1][7]=0; // Paddel Player 2 alte Position löschen 126 | 127 | player1Position=map(analogRead(pot1Pin),0,1023,0,6); // liest die Position von Spieler 1 aus 128 | player2Position=map(analogRead(pot2Pin),0,1023,0,6); // liest die Position von Spieler 2 aus 129 | 130 | image[player1Position][0]=1; // Paddel Player 1 darstellen 131 | image[player1Position+1][0]=1; // Paddel Player 1 darstellen 132 | image[player2Position][7]=1; // Paddel Player 2 darstellen 133 | image[player2Position+1][7]=1; // Paddel Player 2 darstellen 134 | 135 | if (millis()>theTimer+gameSpeed){ // timer für Spielgeschwindigkeit 136 | if (gameSpeed>50) gameSpeed-=3; // spiel wird beschleunigt 137 | theTimer=millis(); // neuer Timer wird gesetzt 138 | image[imageYPosition][imageXPosition]=0; // alte Position wird überschrieben 139 | ballXPosition+=ballXSpeed; // Update der Position 140 | ballYPosition+=ballYSpeed; // Update der Position 141 | 142 | if (ballYPosition>=7) ballYSpeed*=-1; // Koolision unterer Rand 143 | if (ballYPosition<=0) ballYSpeed*=-1; // Koolision oberer Rand 144 | 145 | ballYPosition=constrain(ballYPosition,0,7); // verhindert, dass Werte kleiner 0 oder größer 7 erreicht werden 146 | ballXPosition=constrain(ballXPosition,0,7); // verhindert, dass Werte kleiner 0 oder größer 7 erreicht werden 147 | imageYPosition=round(ballYPosition); 148 | imageXPosition=round(ballXPosition); 149 | 150 | if ((ballXPosition>=6)&&(image[imageYPosition][7]==1)) { // wenn der Ball den Rand erreicht und das Paddel trifft 151 | ballXSpeed*=-1; // Ball wird reflektiert 152 | ballYSpeed=random(-2,3); // Abprallwinkel bekommt Zufallskomponente 153 | } 154 | if ((ballXPosition<=1)&&(image[imageYPosition][0]==1)) { // wenn der Ball den Rand erreicht und das Paddel trifft 155 | ballXSpeed*=-1; // Ball wird reflektiert 156 | ballYSpeed=random(-2,3); // Abprallwinkel bekommt Zufallskomponente 157 | } 158 | if (ballXPosition>=7){ // Ball im Aus 159 | gameState=2; // Spiel verloren Modus wird aktiviert 160 | theTimer=millis(); // neuer Timer wird gesetzt 161 | } 162 | 163 | if (ballXPosition<=0){ // Ball im Aus 164 | gameState=2; // Spiel verloren Modus wird aktiviert 165 | theTimer=millis(); // neuer Timer wird gesetzt 166 | } 167 | 168 | image[imageYPosition][imageXPosition]=1; // neue Position wird eingeschalten 169 | 170 | } 171 | break; 172 | case 2: // Spiel verloren, kurze Nachleuchtzeit 173 | if (millis()>theTimer+gameSpeed){ 174 | theTimer=millis(); 175 | gameState=3; // Spiel verloren Anzeigemodus aufrufen 176 | } 177 | break; 178 | case 3: // Spiel verloren Anzeigemodus 179 | memcpy(image,death,sizeof(death)); // Spiel verloren Bild wird aufgerufen, memcpy ist eine Funktion, die ein Array einem anderen Array gleich setzt 180 | if (millis()>theTimer+animations){ // Wartzeit 181 | gameState=0; // Spiel starten von vorn 182 | } 183 | break; 184 | } 185 | } 186 | 187 | void loop(){ 188 | update(); // alle Berechnungen sind in der update-Methode 189 | draw(); // Darstellung ist in der draw-Methode 190 | } 191 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Potentiometer/Potentiometer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Potentiometer 3 | zwei LEDs werden mit einem Potentiometer gesteuert 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int ledGreen = 6; // LED Pin wird deklariert 9 | int ledRed = 5; // LED Pin wird deklariert 10 | int potPin = 0; // Potentiometer wird deklariert 11 | 12 | void setup(){ 13 | // werder analoge Ein- noch Ausgaben müssen im Setup initialisiert werden 14 | } 15 | 16 | void loop(){ 17 | int value = analogRead(potPin); // die Variable value speichert den Wert des Potentiometers 18 | int redValue = map(value,0,1023,0,255); // diser wird mit der Map-Funktion umgerechnet - hier von 0 bis 255, 19 | int greenValue = map(value,0,1023,255,0); // hier von 255 - 0 20 | 21 | analogWrite(ledRed,redValue); // die umgerechneten Werte 22 | analogWrite(ledGreen,greenValue); // werden an beide LEDs gesendet 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Servo/Servo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Servo 3 | ein Potentiometer steuert die Position eines Servos 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | #include // einbinden der Servo Bibliothek (library) 9 | 10 | Servo myservo; // erzeugt ein Servo-Objekt 11 | int potpin = 0 ; // Potentiometer-Pin wird deklariert 12 | int val; // val speichert den Wert des Potentiometers zwischen 13 | 14 | void setup() 15 | { 16 | myservo.attach(9); // verbindet das Servoobjekt an Pin 9 17 | } 18 | 19 | void loop() 20 | { 21 | val = analogRead(potpin); // Potentiometer-Wert wird ausgelesen 22 | val = map(val, 0, 1023, 0, 179); // und in den Wertebereich von 0 bis 179 überführt 23 | myservo.write(val); // stellt den Servo auf den Wert val 24 | delay(15); // wartet, damit sich der Servo drehen kann 25 | } 26 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Synthesizer/Synthesizer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Synthesizer 3 | erzeugt eine Frequenzschema aus den Werten zweier Potientiometer 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int buzzerPin = 8; // deklariert den Pin des Piezos 9 | int potPin1 = 0; // Potentiometer 0 Pin 10 | int potPin2 = 1; // Potentiometer 1 Pin 11 | 12 | int toneHeight; // speichert die Tonhöhe zwischen 13 | int lfo; // speichert die Frequensgeschwindigkeit 14 | 15 | /* lfo bezeichnet einen "niederfrequenten Oszillator" - also eine zeitliche Frequenzänderung */ 16 | 17 | void setup() { 18 | pinMode(buzzerPin, OUTPUT); // buzzerPin wird als OUTPUT deklariert 19 | } 20 | 21 | void play(int myToneHeight) { // play-Methode 22 | digitalWrite(buzzerPin, HIGH); // Piezo wird angeschalten 23 | delayMicroseconds(myToneHeight); // Wartezeit wird durch toneHeight beeinflusst 24 | digitalWrite(buzzerPin, LOW); // Piezo wird abgeschalten 25 | delayMicroseconds(myToneHeight); // Wartezeit wird durch toneHeight beeinflusst 26 | } 27 | 28 | void loop() { 29 | toneHeight=analogRead(potPin1); // Tonhöhe ist Wert vom Potentiometer 1 30 | lfo=analogRead(potPin2); // lfo ist Wert vom Potentiometer 1 31 | 32 | for (int i = (lfo/10); i > 0; i--) { // Tonhöhe steigend in Abhängigkeit des lfo Wertes 33 | play(toneHeight); 34 | } 35 | delayMicroseconds(lfo); // Pause 36 | for (int i = 0; i < lfo/10; i++) { // Tonhöhe sinkend in Abhängigkeit des lfo Wertes 37 | play(toneHeight); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Uebung1_1/Uebung1_1.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Übung 1_1 Blink Rhythmus 3 | Dieses programm lässt eine LED in einem Rhythmus blinken. 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int led = 13; // ganzzahlige Variable led wird deklariert 9 | 10 | void setup() { // die setup()-Methode wird einmal ausgeführt 11 | pinMode(led, OUTPUT); 12 | } 13 | 14 | void loop() { // die loop()-Methode wird immer wiederholt 15 | digitalWrite(led, HIGH); // schaltet die LED ein 16 | delay(200); // hält das Programm für 200 Millisekunden an 17 | digitalWrite(led, LOW); // schaltet die LED ab 18 | delay(200); // hält das Programm für 200 Millisekunden an 19 | 20 | digitalWrite(led, HIGH); // schaltet die LED ein 21 | delay(200); // hält das Programm für 200 Millisekunden an 22 | digitalWrite(led, LOW); // schaltet die LED ab 23 | delay(200); // hält das Programm für 200 Millisekunden an 24 | 25 | digitalWrite(led, HIGH); // schaltet die LED ein 26 | delay(1000); // hält das Programm für 1000 Millisekunden an 27 | digitalWrite(led, LOW); // schaltet die LED ab 28 | delay(1000); // hält das Programm für 1000 Millisekunden an 29 | } 30 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Uebung1_2a/Uebung1_2a.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Übung 1_2 Blink SOS 3 | Blinkt ein SOS Signal: 4 | * kurz-kurz-kurz = S 5 | * lang-lang-lang = O 6 | * kurz-kurz-kurz = S 7 | 8 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 9 | */ 10 | 11 | int led = 13; // ganzzahlige Variable led wird deklariert 12 | 13 | void setup() { // die setup()-Methode wird einmal ausgeführt 14 | pinMode(led, OUTPUT); 15 | } 16 | 17 | void loop() { // die loop()-Methode wird immer wiederholt 18 | digitalWrite(led, HIGH); // schaltet die LED ein 19 | delay(200); // hält das Programm für 200 Millisekunden an 20 | digitalWrite(led, LOW); // schaltet die LED ab 21 | delay(200); // hält das Programm für 200 Millisekunden an 22 | 23 | digitalWrite(led, HIGH); // schaltet die LED ein 24 | delay(200); // hält das Programm für 200 Millisekunden an 25 | digitalWrite(led, LOW); // schaltet die LED ab 26 | delay(200); // hält das Programm für 200 Millisekunden an 27 | 28 | digitalWrite(led, HIGH); // schaltet die LED ein 29 | delay(200); // hält das Programm für 200 Millisekunden an 30 | digitalWrite(led, LOW); // schaltet die LED ab 31 | delay(200); // hält das Programm für 200 Millisekunden an 32 | 33 | digitalWrite(led, HIGH); // schaltet die LED ein 34 | delay(500); // hält das Programm für 500 Millisekunden an 35 | digitalWrite(led, LOW); // schaltet die LED ab 36 | delay(500); // hält das Programm für 500 Millisekunden an 37 | 38 | digitalWrite(led, HIGH); // schaltet die LED ein 39 | delay(500); // hält das Programm für 500 Millisekunden an 40 | digitalWrite(led, LOW); // schaltet die LED ab 41 | delay(500); // hält das Programm für 500 Millisekunden an 42 | 43 | digitalWrite(led, HIGH); // schaltet die LED ein 44 | delay(500); // hält das Programm für 500 Millisekunden an 45 | digitalWrite(led, LOW); // schaltet die LED ab 46 | delay(500); // hält das Programm für 500 Millisekunden an 47 | 48 | digitalWrite(led, HIGH); // schaltet die LED ein 49 | delay(200); // hält das Programm für 200 Millisekunden an 50 | digitalWrite(led, LOW); // schaltet die LED ab 51 | delay(200); // hält das Programm für 200 Millisekunden an 52 | 53 | digitalWrite(led, HIGH); // schaltet die LED ein 54 | delay(200); // hält das Programm für 200 Millisekunden an 55 | digitalWrite(led, LOW); // schaltet die LED ab 56 | delay(200); // hält das Programm für 200 Millisekunden an 57 | 58 | digitalWrite(led, HIGH); // schaltet die LED ein 59 | delay(200); // hält das Programm für 200 Millisekunden an 60 | digitalWrite(led, LOW); // schaltet die LED ab 61 | delay(2000); // hält das Programm für 2000 Millisekunden an 62 | } 63 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Uebung1_2b/Uebung1_2b.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Übung 1_2b Blink SOS alternativer Weg 3 | Blinkt ein SOS Signal: 4 | * kurz-kurz-kurz = S 5 | * lang-lang-lang = O 6 | * kurz-kurz-kurz = S 7 | 8 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 9 | */ 10 | 11 | int led = 13; // ganzzahlige Variable led wird deklariert 12 | char signals[] = {'.','.','.','-','-','-','.','.','.'}; // variable speichert die Signale: . = kurz, - = lang 13 | 14 | void setup() { // die setup()-Methode wird einmal ausgeführt 15 | pinMode(led, OUTPUT); 16 | } 17 | 18 | void loop() { // die loop()-Methode wird immer wiederholt 19 | for (int i=0; i=1; i=i-1){ // Lauflicht her 25 | digitalWrite(pins[i], HIGH); // LED an der Stelle i einschalten 26 | digitalWrite(pins[7-i], HIGH); // LED an der Stelle 7-i einschalten 27 | delay(100); // hält das Programm für 100 Millisekunden an 28 | digitalWrite(pins[i], LOW); // LED an der Stelle i ausschalten 29 | digitalWrite(pins[7-i], LOW); // LED an der Stelle 7-i ausschalten 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Uebung3_1/Uebung3_1.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Matrix Übung 3 | LED-Matrix zeigt ein anderes Bild 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | // Pinbelegung für Arduino UNO 9 | int reihenPins[8] = {9,3,2,12,15,11,7,6}; // Anschlüsse der Reihenpins am Arduino 10 | int spaltenPins[8] = {13,8,17,10,5,16,4,14}; // Anschlüsse der Spaltenpins am Arduino 11 | 12 | 13 | // Pinbelegung für Arduino MEGA 14 | // int reihenPins[8] = {9,3,2,12,55,11,7,6}; // Anschlüsse der Reihenpins am Arduino 15 | // int spaltenPins[8] = {13,8,57,10,5,56,4,54}; // Anschlüsse der Spaltenpins am Arduino 16 | 17 | int image[8][8]={ // Bild, das auf der Matrix gezeigt wird. 1 = LED an, 0 = LED aus 18 | 19 | {0,0,1,1,0,1,1,0}, 20 | {0,1,0,0,1,0,0,1}, 21 | {0,1,0,0,0,0,0,1}, 22 | {0,0,1,0,0,0,1,0}, 23 | {0,0,0,1,0,1,0,0}, 24 | {0,0,0,0,1,0,0,0}, 25 | {0,0,0,0,0,0,0,0}, 26 | {0,0,0,0,0,0,0,0} 27 | 28 | }; 29 | 30 | void setup(){ 31 | for (int i=0; i<8; i++){ // Alle Pins werden als OUTPUT declariert 32 | pinMode(reihenPins[i],OUTPUT); 33 | pinMode(spaltenPins[i],OUTPUT); 34 | } 35 | } 36 | 37 | void loop(){ 38 | for (int y=0; y<8; y++){ // zeilenweise werden 39 | for (int x=0; x<8; x++){ // von links nach rechts alle Einträge des Arrays geprüft 40 | if (image[x][y]==1){ // ist der Eintrag = 1 41 | digitalWrite(spaltenPins[x],HIGH); // wird der Spaltenpin eingeschalten 42 | } else { // sonst 43 | digitalWrite(spaltenPins[x],LOW); // abgeschalten 44 | } 45 | } 46 | digitalWrite(reihenPins[y],LOW); // nun wird der Reihenpin auf LOW geschalten (da es die Kathode der LED betrifft bedeutet LOW eingeschalten: LOW = GND) 47 | delayMicroseconds(100); // das Programm hällt 100 Mikrosekunden an 48 | digitalWrite(reihenPins[y],HIGH); // danach wird der Reihenpin wieder auf HIGH (in diesem Fall also abge-) schalten 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Uebung3_2/Uebung3_2.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Matrix Übung 3 | LED-Matrix zeigt eine kleine Animation 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | // Pinbelegung für Arduino UNO 9 | int reihenPins[8] = {9,3,2,12,15,11,7,6}; // Anschlüsse der Reihenpins am Arduino 10 | int spaltenPins[8] = {13,8,17,10,5,16,4,14}; // Anschlüsse der Spaltenpins am Arduino 11 | 12 | 13 | // Pinbelegung für Arduino MEGA 14 | // int reihenPins[8] = {9,3,2,12,55,11,7,6}; // Anschlüsse der Reihenpins am Arduino 15 | // int spaltenPins[8] = {13,8,57,10,5,56,4,54}; // Anschlüsse der Spaltenpins am Arduino 16 | 17 | int imageNr=0; // welches Bild wird gerade angezeigt 18 | 19 | long timer=0; // Timervariable 20 | int timeOut=200; // wie lange soll jedes Bild angezeigt werden (ms) 21 | 22 | int image[2][8][8]={{ // erstes Bild, das auf der Matrix gezeigt wird 23 | 24 | {0,1,0,0,0,0,1,0}, 25 | {1,1,1,0,0,1,1,1}, 26 | {0,1,0,0,0,0,1,0}, 27 | {0,0,0,1,1,0,0,0}, 28 | {0,0,0,1,1,0,0,0}, 29 | {1,0,0,0,0,0,0,1}, 30 | {0,1,1,1,1,1,1,0}, 31 | {0,0,1,1,1,1,0,0} 32 | 33 | },{ // zweites Bild, das auf der Matrix gezeigt wird 34 | 35 | {1,0,1,0,0,1,0,1}, 36 | {0,1,0,0,0,0,1,0}, 37 | {1,0,1,0,0,1,0,1}, 38 | {0,0,0,1,1,0,0,0}, 39 | {0,0,0,1,1,0,0,0}, 40 | {1,0,0,0,0,0,0,1}, 41 | {0,1,1,1,1,1,1,0}, 42 | {0,0,1,1,1,1,0,0} 43 | 44 | } 45 | }; 46 | 47 | void setup(){ 48 | for (int i=0; i<8; i++){ // Alle Pins werden als OUTPUT deklariert 49 | pinMode(reihenPins[i],OUTPUT); 50 | pinMode(spaltenPins[i],OUTPUT); 51 | } 52 | } 53 | 54 | void loop(){ 55 | if (timer+timeOut= 0; leuchtwert--) { // fadeValue wird in Fünferschritten runtergezählt 22 | analogWrite(led1Pin, leuchtwert); // und als analoger Wert an die LED übertragen 23 | analogWrite(led2Pin, 255-leuchtwert); // 255-leuchtwert erzeugt genau das umgekehrte Verhalten 24 | delay(2); // kurze Wartezeit 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /de/Arduino/Fritzing Creator Kit/Wahrsager/Wahrsager.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Wahrsager 3 | schaltet zwischen fünf LEDs um die Zukunft vorher zu sagen 4 | 5 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int pins[] = {8,9,10,11,12}; // Pins der einzelnen LEDs werden in einem Array gespeichert 9 | int tiltPin = 3; // Pin-Nummer des Neigungsschalters wird deklariert 10 | 11 | void setup() { 12 | for (int i=0; i<5; i=i+1){ 13 | pinMode(pins[i] , OUTPUT); // LED Pins werden als OUTPUTS deklariert 14 | } 15 | pinMode(tiltPin,INPUT); // Pin des Neigungsschalters wird als INPUT deklariert 16 | randomSeed(analogRead(0)); 17 | } 18 | 19 | void loop() { 20 | if (digitalRead(tiltPin)==HIGH){ // wenn der Tilt-Switch geöffnet ist 21 | for (int i=0; i<5; i=i+1){ // werden alle LEDs 22 | digitalWrite(pins[i],LOW); // abgeschalten 23 | } // sonst 24 | int myRandom=random(0,5); // eine zufällige LED wird ausgewählt 25 | digitalWrite(pins[myRandom],HIGH); // und angeschalten 26 | delay(20); // Programm macht eine kurze Pause 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /de/Fritzing/555Keyfob.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/555Keyfob.fzz -------------------------------------------------------------------------------- /de/Fritzing/Blink.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Blink.fzz -------------------------------------------------------------------------------- /de/Fritzing/Fading.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Fading.fzz -------------------------------------------------------------------------------- /de/Fritzing/FlipFlop.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/FlipFlop.fzz -------------------------------------------------------------------------------- /de/Fritzing/H-Bridge.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/H-Bridge.fzz -------------------------------------------------------------------------------- /de/Fritzing/Lauflicht.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Lauflicht.fzz -------------------------------------------------------------------------------- /de/Fritzing/Lichtautomatik.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Lichtautomatik.fzz -------------------------------------------------------------------------------- /de/Fritzing/Matrix.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Matrix.fzz -------------------------------------------------------------------------------- /de/Fritzing/Messen_Spannung.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Messen_Spannung.fzz -------------------------------------------------------------------------------- /de/Fritzing/Nachtlicht.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Nachtlicht.fzz -------------------------------------------------------------------------------- /de/Fritzing/Orakelwürfel_01.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Orakelwürfel_01.fzz -------------------------------------------------------------------------------- /de/Fritzing/Piezo_Synth_Sch.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Piezo_Synth_Sch.fzz -------------------------------------------------------------------------------- /de/Fritzing/Ping-Pong.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Ping-Pong.fzz -------------------------------------------------------------------------------- /de/Fritzing/Pingpong.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Pingpong.fzz -------------------------------------------------------------------------------- /de/Fritzing/Potentiometer.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Potentiometer.fzz -------------------------------------------------------------------------------- /de/Fritzing/Processing_RGB.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Processing_RGB.fzz -------------------------------------------------------------------------------- /de/Fritzing/Sandbox.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Sandbox.fzz -------------------------------------------------------------------------------- /de/Fritzing/SchematicsRref.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/SchematicsRref.fzz -------------------------------------------------------------------------------- /de/Fritzing/Servo.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Servo.fzz -------------------------------------------------------------------------------- /de/Fritzing/Synthesizer.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Synthesizer.fzz -------------------------------------------------------------------------------- /de/Fritzing/TwitterSaurus.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/TwitterSaurus.fzz -------------------------------------------------------------------------------- /de/Fritzing/Verstaerkung.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Verstaerkung.fzz -------------------------------------------------------------------------------- /de/Fritzing/Verstärkung.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Verstärkung.fzz -------------------------------------------------------------------------------- /de/Fritzing/Wahrsager.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Wahrsager.fzz -------------------------------------------------------------------------------- /de/Fritzing/Wahrsager222.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Wahrsager222.fzz -------------------------------------------------------------------------------- /de/Fritzing/Zaubertafel.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Fritzing/Zaubertafel.fzz -------------------------------------------------------------------------------- /de/Processing/RGB/RGB.pde: -------------------------------------------------------------------------------- 1 | import processing.serial.*; 2 | import cc.arduino.*; 3 | 4 | Arduino meinArduino; 5 | 6 | int potPin=0; 7 | int value; 8 | 9 | int redX = 20; 10 | int greenX = 20; 11 | int blueX = 20; 12 | 13 | int redPin = 9; 14 | int greenPin = 10; 15 | int bluePin = 11; 16 | 17 | int oldGreen; 18 | int oldRed; 19 | int oldBlue; 20 | 21 | void setup() { 22 | size(255,300,P3D); 23 | println(Serial.list()); // List all the available serial ports: 24 | meinArduino = new Arduino(this, Arduino.list()[4], 57600); 25 | noStroke(); 26 | } 27 | 28 | void graphics(int theValue){ 29 | colorMode(RGB,255); 30 | background(0); 31 | fill(100); 32 | rect(0,20,width,20); 33 | rect(0,60,width,20); 34 | rect(0,100,width,20); 35 | fill(255,0,0); rect(0,20,redX,20); 36 | fill(0,255,0); rect(0,60,greenX,20); 37 | fill(0,0,255); rect(0,100,blueX,20); 38 | colorMode(HSB, 100); 39 | fill(value,100,100); 40 | rect(0,160,width,height); 41 | } 42 | 43 | void draw(){ 44 | value=meinArduino.analogRead(potPin); 45 | value=(int)map(value,0,1023,0,100); 46 | if (mousePressed==true){ 47 | if ((mouseX>0)&&(mouseX<=width)){ 48 | if ((mouseY>20)&&(mouseY<40)) { 49 | redX = mouseX; 50 | } 51 | if ((mouseY>60)&&(mouseY<80)) { 52 | greenX = mouseX; 53 | } 54 | if ((mouseY>100)&&(mouseY<120)) { 55 | blueX = mouseX; 56 | } 57 | } 58 | } 59 | 60 | graphics(value); 61 | 62 | if (redX!=oldRed){ 63 | meinArduino.analogWrite(redPin,redX); 64 | oldRed=redX; 65 | } 66 | if (greenX!=oldGreen){ 67 | meinArduino.analogWrite(greenPin,greenX); 68 | oldGreen=greenX; 69 | } 70 | if (blueX!=oldBlue){ 71 | meinArduino.analogWrite(bluePin,blueX); 72 | oldBlue=blueX; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /de/Processing/TwitterSaurus/TwitterSaurus.pde: -------------------------------------------------------------------------------- 1 | import processing.serial.*; // Einbinden der Serial Programmbibliothek 2 | import cc.arduino.*; // Einbinden der Arduino Programmbibliothek 3 | import ddf.minim.*; // Einbinden der Minim Programmbibliothek für die Soundausgabe 4 | 5 | /* 6 | TwitterSaurus 7 | Dieses Programm sucht nach einem Suchbegriff auf Twitter. Wenn ein neuer Beitrag geschrieben wird, 8 | wird ein Sound ausgelöst und ein Servo dreht sich. Er bewegt das Maul des Dinosauriers des Fritzing Creator Kits. 9 | 10 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 11 | */ 12 | 13 | 14 | String myQuery="Dino"; // Begriff, nach dem gesucht werden soll 15 | 16 | Twitter twitter; // Erzeugt ein Twitter-Objekt 17 | Query query; // Erzeugt ein Query-Objekt 18 | Arduino arduino; // Erzeugt ein Arduino-Objekt 19 | Minim minim; // Erzeugt ein Minim-Objekt 20 | AudioSample sound1; // Erzeugt ein AudioSample-Objekt 21 | PFont font; // Erzeugt ein PFont-Objekt 22 | 23 | long timer; // Timer wird angelegt 24 | int timeout=1000; // Timeout – wie oft soll geprüft werden? 25 | 26 | String lastMessage=""; // speichert die letzte Twittermeldung 27 | String currentMessage=""; // speichert die aktuelle Twittermeldung 28 | 29 | TwitterFactory twitterFactory; // Erstelle ein Twitter-Factory Objekt 30 | 31 | int servoPin=10; // Servo an Arduino-Pin 32 | 33 | void setup(){ 34 | size(400,200); // legt die Größe des Programmfensters fest 35 | ConfigurationBuilder cb = new ConfigurationBuilder(); // ConfigurationBuilder für Twitter 36 | cb.setOAuthConsumerKey("uzr17kGYqhgNDjTBNQd1qA"); // Hier muss Dein ConsumerKey eingegeben werden 37 | cb.setOAuthConsumerSecret("ZZUfCHruwv4d6Tn9uGz0UGebxfn4oQDikv3NeCbd14"); // Hier muss Dein ConsumerSecret eingegeben werden 38 | cb.setOAuthAccessToken("221060254-8MJIyVpXotDhemKaJKVN88L1FlCcndToB8y143LU"); // Hier muss Dein AccessToken eingegeben werden 39 | cb.setOAuthAccessTokenSecret("A2R7IkcSniMnBHYeRK02umHoIvrsHQAdx4NaMq6toY"); // Hier muss Dein AccessTokenSecret eingegeben werden 40 | 41 | twitterFactory = new TwitterFactory(cb.build()); // öffnet eine Verbindung zu Twitter 42 | twitter = twitterFactory.getInstance(); 43 | 44 | minim = new Minim(this); // Minim (Bibliothek für die Soundausgabe) wird initialisiert 45 | sound1 = minim.loadSample("sound1.wav"); // Sounddatei wird geladen 46 | font = loadFont("OCRAStd-14.vlw"); // Font-Datei wird geladen 47 | textFont(font); // Font wird initialisiert 48 | println(Arduino.list()); // Alle seriellen Geräte werden in einer Liste ausgegeben, die Nummer für das Arduino muss 49 | arduino = new Arduino(this, Arduino.list()[4]); // hier übergeben werden: Arduino.list()[nummer] 50 | arduino.pinMode(servoPin, Arduino.OUTPUT); // Servo Pin wird im Arduino als Output festgelegt 51 | } 52 | 53 | void alertMe(){ // Methode wird aufgerufen, wenn es eine neue Nachricht gibt 54 | sound1.trigger(); // Soundsample wird abgespielt 55 | arduino.analogWrite(servoPin, 120); // Servo wird gedreht 56 | delay(500); // warten 57 | arduino.analogWrite(servoPin, 20); // Servo wird gedreht 58 | delay(500); // warten 59 | } 60 | 61 | void twitterConnect(){ // Methode für die Verbindung zu Twitter 62 | try { // versuche 63 | Query query = new Query(myQuery); 64 | QueryResult result = twitter.search(query); 65 | for (Status status : result.getTweets()) { 66 | println("@" + status.getUser().getScreenName() + ":" + status.getText()); 67 | currentMessage="@" + status.getUser().getScreenName() + ":" + status.getText(); 68 | } 69 | } 70 | catch (TwitterException e) { // bei Fehler 71 | println("Couldn't connect: " + e); // Fehlermeldung wird ausgegeben 72 | }; 73 | } 74 | 75 | void draw(){ // draw Methode ist wie loop in Arduino 76 | if (millis()>timer+timeout){ // wenn wartezeit vorüber 77 | twitterConnect(); // Methodenaufruf 78 | timer=millis(); // timer wird neu gestartet 79 | } 80 | 81 | if (currentMessage.equals(lastMessage) == false) { // wenn aktuelle Nachricht anders als letzte Nachricht ist 82 | background(0); // Hindergrund füllen 83 | text(currentMessage, 10, 20,width-20,height-40); // Tweet als Text ausgeben 84 | alertMe(); // Methodenaufruf 85 | lastMessage=currentMessage; // letzteNachricht auf aktuelle Nachricht senden 86 | } 87 | } 88 | 89 | -------------------------------------------------------------------------------- /de/Processing/TwitterSaurus/code/twitter4j-core-3.0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Processing/TwitterSaurus/code/twitter4j-core-3.0.3.jar -------------------------------------------------------------------------------- /de/Processing/TwitterSaurus/data/OCRAStd-14.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Processing/TwitterSaurus/data/OCRAStd-14.vlw -------------------------------------------------------------------------------- /de/Processing/TwitterSaurus/data/sound1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/de/Processing/TwitterSaurus/data/sound1.wav -------------------------------------------------------------------------------- /de/Processing/TwitterSaurus2/TwitterSaurus2.pde: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Just a simple Processing and Twitter thingy majiggy 4 | 5 | RobotGrrl.com 6 | 7 | Code licensed under: 8 | CC-BY 9 | 10 | */ 11 | 12 | // First step is to register your Twitter application at dev.twitter.com 13 | // Once registered, you will have the info for the OAuth tokens 14 | // You can get the Access token info by clicking on the button on the 15 | // right on your twitter app's page 16 | // Good luck, and have fun! 17 | 18 | // This is where you enter your Oauth info 19 | static String OAuthConsumerKey = "uzr17kGYqhgNDjTBNQd1qA"; 20 | static String OAuthConsumerSecret = "ZZUfCHruwv4d6Tn9uGz0UGebxfn4oQDikv3NeCbd14"; 21 | 22 | // This is where you enter your Access Token info 23 | static String AccessToken = "221060254-8MJIyVpXotDhemKaJKVN88L1FlCcndToB8y143LU"; 24 | static String AccessTokenSecret = "A2R7IkcSniMnBHYeRK02umHoIvrsHQAdx4NaMq6toY"; 25 | 26 | // Just some random variables kicking around 27 | String myTimeline; 28 | java.util.List statuses = null; 29 | User[] friends; 30 | TwitterFactory twitterFactory; 31 | //Twitter twitter; 32 | 33 | Twitter twitter = TwitterFactory.getSingleton(); 34 | 35 | 36 | RequestToken requestToken; 37 | String[] theSearchTweets = new String[11]; 38 | 39 | 40 | 41 | void setup() { 42 | 43 | size(100,100); 44 | background(0); 45 | 46 | connectTwitter(); 47 | //sendTweet("Hey from Simple Processing woop woop #loadedsith #robotgirl"); 48 | //getTimeline(); 49 | getSearchTweets(); 50 | 51 | } 52 | 53 | 54 | void draw() { 55 | 56 | background(0); 57 | 58 | } 59 | 60 | 61 | // Initial connection 62 | void connectTwitter() { 63 | ConfigurationBuilder cb = new ConfigurationBuilder(); 64 | cb.setOAuthConsumerKey(OAuthConsumerKey); 65 | cb.setOAuthConsumerSecret( OAuthConsumerSecret ); 66 | cb.setOAuthAccessToken( AccessToken); 67 | cb.setOAuthAccessTokenSecret( AccessTokenSecret ); 68 | twitterFactory = new TwitterFactory(cb.build()); 69 | twitter = twitterFactory.getInstance(); 70 | println("connected"); 71 | } 72 | 73 | // Sending a tweet 74 | void sendTweet(String t) { 75 | 76 | try { 77 | Status status = twitter.updateStatus(t); 78 | println("Successfully updated the status to [" + status.getText() + "]."); 79 | } catch(TwitterException e) { 80 | println("Send tweet: " + e + " Status code: " + e.getStatusCode()); 81 | } 82 | 83 | } 84 | 85 | 86 | // Loading up the access token 87 | private static AccessToken loadAccessToken(){ 88 | return new AccessToken(AccessToken, AccessTokenSecret); 89 | } 90 | 91 | 92 | // Get your tweets 93 | void getTimeline() { 94 | 95 | try { 96 | statuses = twitter.getUserTimeline(); 97 | } catch(TwitterException e) { 98 | println("Get timeline: " + e + " Status code: " + e.getStatusCode()); 99 | } 100 | 101 | for(int i=0; ischaltgrenze){ // wenn die Schaltgrenze unterschritten wird 24 | timer=millis(); // timer wird auf aktuelle Zeit gesetzt 25 | digitalWrite(scheinwerferPin, HIGH); // Scheinwerfer werden eingeschalten 26 | } else if (millis()>wartezeit+timer){ // sonst wenn er Timer abgelaufen ist 27 | digitalWrite(scheinwerferPin, LOW); // werden die Scheinwerfer abgeschalten 28 | } 29 | delay(10); // Pause 30 | } 31 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Blink/Blink.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Blink 3 | 4 | Switching a LED on and off 5 | 6 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 7 | */ 8 | 9 | int led = 13; // integer variable led is declared 10 | 11 | void setup() { // the setup() method is executed only once 12 | pinMode(led, OUTPUT); // the led PIN is declared as digital output 13 | } 14 | 15 | void loop() { // the loop() method is repeated 16 | digitalWrite(led, HIGH); // switching on the led 17 | delay(1000); // stopping the program for 1000 milliseconds 18 | digitalWrite(led, LOW); // switching off the led 19 | delay(1000); // stopping the program for 1000 milliseconds 20 | } 21 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Chaserlights/Chaserlights.ino: -------------------------------------------------------------------------------- 1 | /* 2 | chaserlights 3 | 4 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 5 | */ 6 | 7 | int pinsCount=8; // declaring the integer variable pinsCount 8 | int pins[] = {2,3,4,5,6,7,8,9}; // declaring the array pins[] 9 | 10 | void setup() { 11 | for (int i=0; i0; i=i-1){ // chasing left (except the outer leds) 23 | digitalWrite(pins[i], HIGH); // switching the LED at index i on 24 | delay(100); // stopping the program for 100 milliseconds 25 | digitalWrite(pins[i], LOW); // switching the LED at index i off 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Exercise1_1/Exercise1_1.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Exercise 1_1 Blink Rhythm 3 | This program is blinking an LED a rhythm. 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int led = 13; // integer variable led is declared 9 | 10 | void setup() { // the setup() method is executed only once 11 | pinMode(led, OUTPUT); // the led PIN is declared as digital output 12 | } 13 | 14 | void loop() { // the loop() method is repeated 15 | digitalWrite(led, HIGH); // switching on the led 16 | delay(200); // stopping the program for 200 milliseconds 17 | digitalWrite(led, LOW); // switching off the led 18 | delay(200); // stopping the program for 200 milliseconds 19 | 20 | digitalWrite(led, HIGH); // switching on the led 21 | delay(200); // stopping the program for 200 milliseconds 22 | digitalWrite(led, LOW); // switching off the led 23 | delay(200); // stopping the program for 200 milliseconds 24 | 25 | digitalWrite(led, HIGH); // switching on the led 26 | delay(1000); // stopping the program for 1000 milliseconds 27 | digitalWrite(led, LOW); // switching off the led 28 | delay(1000); // stopping the program for 1000 milliseconds 29 | } 30 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Exercise1_2a/Exercise1_2a.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Exercise 1_2 Blink SOS 3 | This program blinks SOS in Morse code with an LED: 4 | * short-short-short = S 5 | * long-long-long = O 6 | * short-short-short = S 7 | 8 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 9 | */ 10 | 11 | int led = 13; // integer variable led is declared 12 | 13 | void setup() { // the setup() method is executed only once 14 | pinMode(led, OUTPUT); // the led PIN is declared as digital output 15 | } 16 | 17 | void loop() { // the loop() method is repeated 18 | digitalWrite(led, HIGH); // switching on the led 19 | delay(200); // stopping the program for 200 milliseconds 20 | digitalWrite(led, LOW); // switching off the led 21 | delay(200); // stopping the program for 200 milliseconds 22 | 23 | digitalWrite(led, HIGH); // switching on the led 24 | delay(200); // stopping the program for 200 milliseconds 25 | digitalWrite(led, LOW); // switching off the led 26 | delay(200); // stopping the program for 200 milliseconds 27 | 28 | digitalWrite(led, HIGH); // switching on the led 29 | delay(200); // stopping the program for 200 milliseconds 30 | digitalWrite(led, LOW); // switching off the led 31 | delay(200); // stopping the program for 200 milliseconds 32 | 33 | 34 | digitalWrite(led, HIGH); // switching on the led 35 | delay(500); // stopping the program for 500 milliseconds 36 | digitalWrite(led, LOW); // switching off the led 37 | delay(500); // stopping the program for 500 milliseconds 38 | 39 | digitalWrite(led, HIGH); // switching on the led 40 | delay(500); // stopping the program for 500 milliseconds 41 | digitalWrite(led, LOW); // switching off the led 42 | delay(500); // stopping the program for 500 milliseconds 43 | 44 | digitalWrite(led, HIGH); // switching on the led 45 | delay(500); // stopping the program for 500 milliseconds 46 | digitalWrite(led, LOW); // switching off the led 47 | delay(500); // stopping the program for 500 milliseconds 48 | 49 | 50 | digitalWrite(led, HIGH); // switching on the led 51 | delay(200); // stopping the program for 200 milliseconds 52 | digitalWrite(led, LOW); // switching off the led 53 | delay(200); // stopping the program for 200 milliseconds 54 | 55 | digitalWrite(led, HIGH); // switching on the led 56 | delay(200); // stopping the program for 200 milliseconds 57 | digitalWrite(led, LOW); // switching off the led 58 | delay(200); // stopping the program for 200 milliseconds 59 | 60 | digitalWrite(led, HIGH); // switching on the led 61 | delay(200); // stopping the program for 200 milliseconds 62 | digitalWrite(led, LOW); // switching off the led 63 | delay(2000); // stopping the program for 2000 milliseconds to have a longer break 64 | } 65 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Exercise1_2b/Exercise1_2b.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Exercise 1_2 Blink SOS an alternative way 3 | This program blinks SOS in Morse code with an LED: 4 | * short-short-short = S 5 | * long-long-long = O 6 | * short-short-short = S 7 | 8 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 9 | */ 10 | 11 | 12 | int led = 13; // integer variable led is declared 13 | char signals[] = {'.','.','.','-','-','-','.','.','.'}; // variable storing the signals: . = short, - = long 14 | 15 | void setup() { // the setup() method is executed only once 16 | pinMode(led, OUTPUT); // the led PIN is declared as digital output 17 | } 18 | 19 | void loop() { // the loop() method is repeated 20 | for (int i=0; i=1; i=i-1){ // chasing left (except the outer leds) 25 | digitalWrite(pins[i], HIGH); // switching the LED at position i on 26 | digitalWrite(pins[7-i], HIGH); // switching the LED at position 7-i on 27 | delay(100); // stopping the program for 100 milliseconds 28 | digitalWrite(pins[i], LOW); // switching the LED at position i off 29 | digitalWrite(pins[7-i], LOW); // switching the LED at position 7-i off 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Exercise3_1/Exercise3_1.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Matrix Exercise 3 | LED-Matrix displaying a different image 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | // pin order for Arduino UNO 9 | int rowPins[8] = {9,3,2,12,15,11,7,6}; // matrix rows connected to the Arduino 10 | int colPins[8] = {13,8,17,10,5,16,4,14}; // matrix columns connected to the Arduino 11 | 12 | 13 | // pin order for Arduino MEGA 14 | // int rowPins[8] = {9,3,2,12,55,11,7,6}; // matrix rows connected to the Arduino 15 | // int colPins[8] = {13,8,57,10,5,56,4,54}; // matrix columns connected to the Arduino 16 | 17 | int image[8][8]={ // the image shown on the matrix : 1 = LED on, 0 = LED off 18 | 19 | {0,0,1,1,0,1,1,0}, 20 | {0,1,0,0,1,0,0,1}, 21 | {0,1,0,0,0,0,0,1}, 22 | {0,0,1,0,0,0,1,0}, 23 | {0,0,0,1,0,1,0,0}, 24 | {0,0,0,0,1,0,0,0}, 25 | {0,0,0,0,0,0,0,0}, 26 | {0,0,0,0,0,0,0,0} 27 | 28 | }; 29 | 30 | void setup(){ 31 | for (int i=0; i<8; i++){ // all pins are declared as outputs 32 | pinMode(rowPins[i],OUTPUT); 33 | pinMode(colPins[i],OUTPUT); 34 | } 35 | } 36 | 37 | void loop(){ 38 | for (int y=0; y<8; y++){ // rowwise 39 | for (int x=0; x<8; x++){ // check all entries of the array from left to right 40 | if (image[x][y]==1){ // is the entry 1 41 | digitalWrite(colPins[x],HIGH); // switch on column pin 42 | } else { // else 43 | digitalWrite(colPins[x],LOW); // switch it off 44 | } 45 | } 46 | digitalWrite(rowPins[y],LOW); // switch the row pin to LOW (because it is the cathode of the LED; LOW means ON) 47 | delayMicroseconds(100); // stop the program for 100 milliseconds 48 | digitalWrite(colPins[y],HIGH); // switch the row pin to HIGH (this means OFF) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Exercise3_2/Exercise3_2.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Matrix 3 | LED-Matrix displaying a little animation 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | // pin order for Arduino UNO 9 | int rowPins[8] = {9,3,2,12,15,11,7,6}; // matrix rows connected to the Arduino 10 | int colPins[8] = {13,8,17,10,5,16,4,14}; // matrix columns connected to the Arduino 11 | 12 | 13 | // pin order for Arduino MEGA 14 | // int rowPins[8] = {9,3,2,12,55,11,7,6}; // matrix rows connected to the Arduino 15 | // int colPins[8] = {13,8,57,10,5,56,4,54}; // matrix columns connected to the Arduino 16 | 17 | int imageNr=0; // stores what image is currently displayed 18 | 19 | long timer=0; // timer variable 20 | int timeOut=200; // time an image should be displayed (ms) 21 | 22 | int image[2][8][8]={{ // the first image displayed on the matrix 23 | 24 | {0,1,0,0,0,0,1,0}, 25 | {1,1,1,0,0,1,1,1}, 26 | {0,1,0,0,0,0,1,0}, 27 | {0,0,0,1,1,0,0,0}, 28 | {0,0,0,1,1,0,0,0}, 29 | {1,0,0,0,0,0,0,1}, 30 | {0,1,1,1,1,1,1,0}, 31 | {0,0,1,1,1,1,0,0} 32 | 33 | },{ // the second image displayed on the matrix 34 | 35 | {1,0,1,0,0,1,0,1}, 36 | {0,1,0,0,0,0,1,0}, 37 | {1,0,1,0,0,1,0,1}, 38 | {0,0,0,1,1,0,0,0}, 39 | {0,0,0,1,1,0,0,0}, 40 | {1,0,0,0,0,0,0,1}, 41 | {0,1,1,1,1,1,1,0}, 42 | {0,0,1,1,1,1,0,0} 43 | 44 | } 45 | }; 46 | 47 | void setup(){ 48 | for (int i=0; i<8; i++){ // all pins are declared as outputs 49 | pinMode(rowPins[i],OUTPUT); 50 | pinMode(colPins[i],OUTPUT); 51 | } 52 | } 53 | 54 | void loop(){ 55 | if (timer+timeOut= 0; fadeValue -= 5) { // fadeValue is counted down in steps of five 22 | analogWrite(led1Pin, fadeValue); // and sent to the led as an analog value 23 | analogWrite(led2Pin, 255-fadeValue); // 255-fadeValue produces the opposite fading behavior 24 | delay(2); // short stop 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Fading/Fading.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Fading 3 | fading an LED slowly on and off again 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int ledPin = 9; // ledPin is declared 9 | 10 | void setup(){ 11 | // no need to declare the analog output in the setup 12 | } 13 | 14 | void loop(){ 15 | for(int fadeValue = 0; fadeValue <= 255; fadeValue += 5) { // fadeValue is counted up in steps of five 16 | analogWrite(ledPin, fadeValue); // and sent to the led as an analog value 17 | delay(2); // short stop 18 | } 19 | for(int fadeValue = 255; fadeValue >= 0; fadeValue -= 5) { // fadeValue is counted down in steps of five 20 | analogWrite(ledPin, fadeValue); // and sent to the led as an analog value 21 | delay(2); // short stop 22 | } 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/FlipFlop/FlipFlop.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Flip Flop 3 | switching between two LEDs using a button 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int buttonPin=2; // Pin where the button is attached 9 | int greenLED=9; // Pin where the green LED is attached 10 | int redLED=10; // Pin where the red LED is attached 11 | 12 | void setup(){ 13 | pinMode(buttonPin, INPUT); // button is initialised as INPUT 14 | pinMode(greenLED, OUTPUT); // green LED pin is initialised as OUTPUT 15 | pinMode(redLED, OUTPUT); // red LED pin is initialised as OUTPUT 16 | } 17 | 18 | void loop(){ 19 | if (digitalRead(buttonPin)==LOW){ // if the button is pressed (LOW) 20 | digitalWrite(greenLED, HIGH); // switch on green LED 21 | digitalWrite(redLED, LOW); // switch off red LED 22 | } else { // else (if button is not pressed) 23 | digitalWrite(greenLED, LOW); // switch off green LED 24 | digitalWrite(redLED, HIGH); // switch on red LED 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Fortuneteller/Fortuneteller.ino: -------------------------------------------------------------------------------- 1 | /* 2 | fortune teller 3 | switching between five LEDs to tell the future 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creatorkit. 6 | */ 7 | 8 | int pins[] = {8,9,10,11,12}; // the pins of the LEDs are stored in an array 9 | int tiltPin = 3; // pin number where the tilt switch is attached 10 | 11 | void setup() { 12 | for (int i=0; i<5; i=i+1){ 13 | pinMode(pins[i] , OUTPUT); // LED pins are declared as outputs 14 | } 15 | pinMode(tiltPin,INPUT); // pin of the tilt switch is declared as input 16 | randomSeed(analogRead(0)); // initialize random number generator based on random state of pin zero 17 | } 18 | 19 | void loop() { 20 | if (digitalRead(tiltPin)==HIGH){ // when the tilt switch is open 21 | for (int i=0; i<5; i=i+1){ // all the LEDs 22 | digitalWrite(pins[i],LOW); // get switched off 23 | } // 24 | int myRandom=random(0,5); // a random LED 25 | digitalWrite(pins[myRandom],HIGH); // is switched on 26 | delay(20); // the program is waiting to breath 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Matrix/Matrix.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Matrix 3 | LED-Matrix displaying image 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | // pin order for Arduino UNO 9 | int rowPins[8] = {9,3,2,12,15,11,7,6}; // matrix rows connected to the Arduino 10 | int colPins[8] = {13,8,17,10,5,16,4,14}; // matrix columns connected to the Arduino 11 | 12 | 13 | // pin order for Arduino MEGA 14 | // int rowPins[8] = {9,3,2,12,55,11,7,6}; // matrix rows connected to the Arduino 15 | // int colPins[8] = {13,8,57,10,5,56,4,54}; // matrix columns connected to the Arduino 16 | 17 | int image[8][8]={ // the image displayed on the matrix : 1 = LED on, 0 = LED off 18 | 19 | {0,1,0,0,0,0,1,0}, 20 | {1,1,1,0,0,1,1,1}, 21 | {0,1,0,0,0,0,1,0}, 22 | {0,0,0,1,1,0,0,0}, 23 | {0,0,0,1,1,0,0,0}, 24 | {1,0,0,0,0,0,0,1}, 25 | {0,1,1,1,1,1,1,0}, 26 | {0,0,1,1,1,1,0,0} 27 | 28 | }; 29 | 30 | void setup(){ 31 | for (int i=0; i<8; i++){ // all pins are declared as outputs 32 | pinMode(rowPins[i],OUTPUT); 33 | pinMode(colPins[i],OUTPUT); 34 | } 35 | } 36 | 37 | void loop(){ 38 | for (int y=0; y<8; y++){ // rowwise 39 | for (int x=0; x<8; x++){ // check all entries of the array from left to right 40 | if (image[x][y]==1){ // is the entry 1 41 | digitalWrite(colPins[x],HIGH); // switch on column pin 42 | } else { // else 43 | digitalWrite(colPins[x],LOW); // switch it off 44 | } 45 | } 46 | digitalWrite(rowPins[y],LOW); // switch the row pin to LOW (because it is the cathode of the LED; LOW means ON) 47 | delayMicroseconds(100); // stop the program for 100 milliseconds 48 | digitalWrite(rowPins[y],HIGH); // switch the row pin to HIGH (this means OFF) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Motor/Motor.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Motor 3 | turning a motor clock then counter clock wise 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creatorkit. 6 | */ 7 | 8 | int motor_A=6; // motor A Pin 9 | int motor_B=5; // motor B Pin 10 | int motor_Speed=3; // speed Pin 11 | 12 | void setup(){ 13 | pinMode(motor_A,OUTPUT); // pin A declared as OUTPUT 14 | pinMode(motor_B,OUTPUT); // pin B declared as OUTPUT 15 | } 16 | 17 | void loop(){ 18 | digitalWrite(motor_A,HIGH); // motor A pin switched to HIGH (+5V) 19 | digitalWrite(motor_B,LOW); // motor B pin switched to LOW (GND) 20 | for (int i=0; i<256; i+=5){ // count up to 255 in steps of five 21 | analogWrite(motor_Speed,i); // and write it as speed to the speed pin 22 | delay(20); // wait 20 ms 23 | } 24 | for (int i=255; i>0; i-=5){ // count down from 255 to 0 by 5 25 | analogWrite(motor_Speed,i); // and write it as speed to the speed pin 26 | delay(20); // wait 20 ms 27 | } 28 | 29 | digitalWrite(motor_A,LOW); // motor A pin switched to HIGH (GND) 30 | digitalWrite(motor_B,HIGH); // motor B pin switched to LOW (+5V) 31 | for (int i=0; i<256; i+=5){ // count up to 255 in steps of five 32 | analogWrite(motor_Speed,i); // and write it as speed to the speed pin 33 | delay(20); // wait 20 ms 34 | } 35 | for (int i=255; i>0; i-=5){ // count down from 255 to 0 by 5 36 | analogWrite(motor_Speed,i); // and write it as speed to the speed pin 37 | delay(20); // wait 20 ms 38 | } 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Nightlight/Nightlight.ino: -------------------------------------------------------------------------------- 1 | /* 2 | night light 3 | fading through the colors of a rainbow 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creatorkit. 6 | */ 7 | 8 | int LEDGreen=9; // LEDGreen pin declared 9 | int LEDBlue=10; // LEDBlue pin declared 10 | int LEDRed=11; // LEDRed pin declared 11 | 12 | void setup(){ 13 | pinMode(LEDRed,OUTPUT); // pin is output 14 | pinMode(LEDGreen,OUTPUT); // pin is output 15 | pinMode(LEDBlue,OUTPUT); // pin is output 16 | } 17 | 18 | void loop(){ 19 | for (int frame=0; frame<900; frame++){ // frame is counted up from 0 to 900 20 | if (frame<150) { // if frame < 150 => red 21 | analogWrite(LEDRed,255); // LED switched on 22 | analogWrite(LEDBlue,0); // switch off LED 23 | analogWrite(LEDGreen,0); // switch off LED 24 | } else if (frame<300) { // if frame < 300 25 | analogWrite(LEDRed,map(frame,150,300,255,0)); // fade off LED 26 | analogWrite(LEDBlue,map(frame,150,300,0,255)); // fade on LED 27 | analogWrite(LEDGreen,0); // switch off LED 28 | } else if (frame<450) { // if frame < 450 => blue 29 | analogWrite(LEDRed,0); // switch off LED 30 | analogWrite(LEDBlue,255); // switch on LED 31 | analogWrite(LEDGreen,0); // switch off LED 32 | } else if (frame<600) { // if frame < 600 33 | analogWrite(LEDRed,0); // switch off LED 34 | analogWrite(LEDBlue,map(frame,450,600,255,0)); // fade off LED 35 | analogWrite(LEDGreen,map(frame,450,600,0,255)); // fade on LED 36 | } else if (frame<750) { // if frame < 750 => green 37 | analogWrite(LEDRed,0); // switch off LED 38 | analogWrite(LEDBlue,0); // switch off LED 39 | analogWrite(LEDGreen,255); // switch off LED 40 | } else if (frame<900) { // if frame < 900 41 | analogWrite(LEDRed,map(frame,750,900,0,255)); // fade on LED 42 | analogWrite(LEDBlue,0); // switch off LED 43 | analogWrite(LEDGreen,map(frame,750,900,255,0)); // fade off LED 44 | } 45 | delay(10); // short break 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/PingPong/PingPong.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Ping Pong game 3 | LED-Matrix is used to play Ping Pong 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | // pin order for Arduino UNO 9 | int rowPins[8] = {9,3,2,12,15,11,7,6}; // matrix rows connected to the Arduino 10 | int colPins[8] = {13,8,17,10,5,16,4,14}; // matrix columns connected to the Arduino 11 | 12 | 13 | // pin order for Arduino MEGA 14 | // int rowPins[8] = {9,3,2,12,55,11,7,6}; // matrix rows connected to the Arduino 15 | // int colPins[8] = {13,8,57,10,5,56,4,54}; // matrix columns connected to the Arduino 16 | 17 | int pot1Pin=4; // declaring the pin for player 1's potentiometer (Analog Input 4) 18 | int pot2Pin=5; // declaring the pin for player 2's potentiometer (Analog Input 5) 19 | 20 | int image[8][8]={ // clear 21 | {0,0,0,0,0,0,0,0}, 22 | {0,0,0,0,0,0,0,0}, 23 | {0,0,0,0,0,0,0,0}, 24 | {0,0,0,0,0,0,0,0}, 25 | {0,0,0,0,0,0,0,0}, 26 | {0,0,0,0,0,0,0,0}, 27 | {0,0,0,0,0,0,0,0}, 28 | {0,0,0,0,0,0,0,0} 29 | }; 30 | 31 | int death[8][8]={ // all on 32 | {1,1,1,1,1,1,1,1}, 33 | {1,1,1,1,1,1,1,1}, 34 | {1,1,1,1,1,1,1,1}, 35 | {1,1,1,1,1,1,1,1}, 36 | {1,1,1,1,1,1,1,1}, 37 | {1,1,1,1,1,1,1,1}, 38 | {1,1,1,1,1,1,1,1}, 39 | {1,1,1,1,1,1,1,1} 40 | }; 41 | 42 | int death2[8][8]={ // skull 43 | {0,1,1,1,1,1,0,0}, 44 | {1,1,1,1,1,1,1,0}, 45 | {1,0,0,1,0,0,1,0}, 46 | {1,1,1,1,1,1,1,0}, 47 | {0,1,1,1,1,1,0,0}, 48 | {0,1,0,1,0,1,0,0}, 49 | {0,1,0,1,0,1,0,0}, 50 | {0,0,0,0,0,0,0,0} 51 | }; 52 | 53 | int blank[8][8]={ // all off 54 | {0,0,0,0,0,0,0,0}, 55 | {0,0,0,0,0,0,0,0}, 56 | {0,0,0,0,0,0,0,0}, 57 | {0,0,0,0,0,0,0,0}, 58 | {0,0,0,0,0,0,0,0}, 59 | {0,0,0,0,0,0,0,0}, 60 | {0,0,0,0,0,0,0,0}, 61 | {0,0,0,0,0,0,0,0} 62 | }; 63 | 64 | long theTimer; // timer variable 65 | 66 | int gameState=0; // storing the game status 67 | int animations=300; // storing the duration of the images between the games 68 | 69 | float ballXSpeed = 1; // storing the x acceleration 70 | float ballXPosition=4; // storing the ball position as number 71 | 72 | float ballYSpeed = 0; // storing the y acceleration 73 | float ballYPosition=4; // storing the ball position as number 74 | 75 | int imageYPosition; // storing the image position as number 76 | int imageXPosition; // storing the image position as number 77 | 78 | int player1Position=3; // storing the paddle positoin of player 1 79 | int player2Position=3; // storing the paddle positoin of player 2 80 | 81 | int gameSpeed; // storing the current game speed 82 | 83 | void setup(){ 84 | for (int i=0; i<8; i++){ // all pins are outputs 85 | pinMode(rowPins[i],OUTPUT); 86 | pinMode(colPins[i],OUTPUT); 87 | } 88 | } 89 | 90 | void draw(){ 91 | for (int y=0; y<8; y++){ // rowwise 92 | for (int x=0; x<8; x++){ // from left to right, entries are checked 93 | if (image[x][y]==1){ // if entry equals 1 94 | digitalWrite(colPins[x],HIGH); // the column pin is switched on 95 | } else { // else 96 | digitalWrite(colPins[x],LOW); // the column pin is switched off 97 | } 98 | } 99 | digitalWrite(rowPins[y],LOW); // switch the row pin to LOW (because it is the cathod of the LED LOW menas ON) 100 | delayMicroseconds(1000); // stop the program for 1 seconds 101 | digitalWrite(rowPins[y],HIGH); // switch the row pin to HIGH (what means OFF) 102 | } 103 | } 104 | 105 | void update(){ 106 | switch (gameState) { // switching game mode (called state machine) 107 | case 0: // new game 108 | memcpy(image,blank,sizeof(blank)); // clear screen 109 | gameSpeed=300; // set the game speed 110 | ballXPosition=3; // set ball position 111 | ballYPosition=3; // set ball position 112 | ballYSpeed=0; // ball should fly straight 113 | if (random(0,2)>0){ // but randomly left or right 114 | ballXSpeed=1; 115 | } else { 116 | ballXSpeed=-1; 117 | } 118 | theTimer=millis(); 119 | gameState=1; 120 | break; 121 | case 1: // game active 122 | image[player1Position][0]=0; // paddle player 1 clear old position 123 | image[player1Position+1][0]=0; // paddle player 1 clear old position 124 | image[player2Position][7]=0; // paddle player 2 clear old position 125 | image[player2Position+1][7]=0; // paddle player 2 clear old position 126 | 127 | player1Position=map(analogRead(pot1Pin),0,1023,0,6); // reading the position of player 1 128 | player2Position=map(analogRead(pot2Pin),0,1023,0,6); // reading the position of player 2 129 | 130 | image[player1Position][0]=1; // paddle player 1 display 131 | image[player1Position+1][0]=1; // paddle player 1 display 132 | image[player2Position][7]=1; // paddle player 2 display 133 | image[player2Position+1][7]=1; // paddle player 2 display 134 | 135 | if (millis()>theTimer+gameSpeed){ // timer for game speed 136 | if (gameSpeed>50) gameSpeed-=3; // accelerate game 137 | theTimer=millis(); // set new timer 138 | image[imageYPosition][imageXPosition]=0; // overwrite old position 139 | ballXPosition+=ballXSpeed; // update position 140 | ballYPosition+=ballYSpeed; // update position 141 | 142 | if (ballYPosition>=7) ballYSpeed*=-1; // collision bottom border 143 | if (ballYPosition<=0) ballYSpeed*=-1; // collision top border 144 | 145 | ballYPosition=constrain(ballYPosition,0,7); // constrain values between 0 and 7 146 | ballXPosition=constrain(ballXPosition,0,7); // constrain values between 0 and 7 147 | imageYPosition=round(ballYPosition); 148 | imageXPosition=round(ballXPosition); 149 | 150 | if ((ballXPosition>=6)&&(image[imageYPosition][7]==1)) { // if ball hits a paddle 151 | ballXSpeed*=-1; // reflect the ball 152 | ballYSpeed=random(-2,3); // random reflection angle 153 | } 154 | if ((ballXPosition<=1)&&(image[imageYPosition][0]==1)) { // if ball hits a paddle 155 | ballXSpeed*=-1; // reflect the ball 156 | ballYSpeed=random(-2,3); // random reflection angle 157 | } 158 | if (ballXPosition>=7){ // ball out 159 | gameState=2; // change status to lost game 160 | theTimer=millis(); // new timer is set 161 | } 162 | 163 | if (ballXPosition<=0){ // ball out 164 | gameState=2; // change status to lost game 165 | theTimer=millis(); // new timer is set 166 | } 167 | 168 | image[imageYPosition][imageXPosition]=1; // set new image position 169 | 170 | } 171 | break; 172 | case 2: // game was lost 173 | if (millis()>theTimer+gameSpeed){ // wait for a short time 174 | theTimer=millis(); 175 | gameState=3; // game state to lost game display 176 | } 177 | break; 178 | case 3: // lost game display 179 | memcpy(image,death,sizeof(death)); // show image of lost game, memcpy is a function copying one array to another 180 | if (millis()>theTimer+animations){ // wait again 181 | gameState=0; // game state change to »start a game« 182 | } 183 | break; 184 | } 185 | } 186 | 187 | void loop(){ 188 | update(); // all calculations are in the update method 189 | draw(); // all display methods are in here 190 | } 191 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Potentiometer/Potentiometer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | potentiometer 3 | two LEDs are controlled by a potentiometer 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int ledGreen = 6; // LED pin is declared 9 | int ledRed = 5; // LED pin is declared 10 | int potPin = 0; // potentiometer pin is declared 11 | 12 | void setup(){ 13 | // neither analog inputs nor outputs have to be declared in the setup 14 | } 15 | 16 | void loop(){ 17 | int value = analogRead(potPin); // this variable stores the value from the potentiometer 18 | int redValue = map(value,0,1023,0,255); // mapped from a range of 0 to 1023 to a range of 0 to 255 for the red LED, 19 | int greenValue = map(value,0,1023,255,0); // and for the green mapped to the reverse range from 255 to 0 20 | 21 | analogWrite(ledRed,redValue); // the recalculated values are 22 | analogWrite(ledGreen,greenValue); // send to the LEDs as analog values 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Servo/Servo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Servo 3 | a potentiometer controls the position of a servo 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | #include // include the library Servo.h 9 | 10 | Servo myservo; // creates a servo object 11 | int potpin = 0 ; // potentiometer pin declaration 12 | int val; // val stores the position of the potentiometer 13 | 14 | void setup() 15 | { 16 | myservo.attach(9); // connects a servo object to pin 9 17 | } 18 | 19 | void loop() 20 | { 21 | val = analogRead(potpin); // potentiometer value is read out 22 | val = map(val, 0, 1023, 0, 179); // and mapped to the range 0 to 179 23 | myservo.write(val); // turning the servo to the angle in val 24 | delay(15); // give the servo time to react 25 | } 26 | -------------------------------------------------------------------------------- /en/Arduino/Fritzing Creator Kit/Synthesizer/Synthesizer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Synthesizer 3 | creating sound from electronics 4 | 5 | This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit. 6 | */ 7 | 8 | int buzzerPin = 8; // piezo pin declaration 9 | int potPin1 = 0; // potentiometer 1 pin declaration 10 | int potPin2 = 1; // potentiometer 2 pin declaration 11 | 12 | int toneHeight; // store the tone height 13 | int lfo; // store the frequency speed 14 | 15 | /* lfo is a "low frequency oscillator" - so a frequency change depending on time */ 16 | 17 | void setup() { 18 | pinMode(buzzerPin, OUTPUT); // buzzerPin as output 19 | } 20 | 21 | void play(int myToneHeight) { // play method 22 | digitalWrite(buzzerPin, HIGH); // piezo is switched on 23 | delayMicroseconds(myToneHeight); // stopping time influenced by toneHeight 24 | digitalWrite(buzzerPin, LOW); // piezo is switched off 25 | delayMicroseconds(myToneHeight); // stopping time influenced by toneHeight 26 | } 27 | 28 | void loop() { 29 | toneHeight=analogRead(potPin1); // toneheight is value of potentiometer 1 30 | lfo=analogRead(potPin2); // lfo is value of potentiometer 2 31 | 32 | for (int i = (lfo/10); i > 0; i--) { // toneheight rising depending on lfo 33 | play(toneHeight); // execute play method 34 | } 35 | delayMicroseconds(lfo); // break 36 | for (int i = 0; i < lfo/10; i++) { // toneheight sinking depending on lfo 37 | play(toneHeight); // execute play method 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /en/Fritzing/555Keyfob.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/555Keyfob.fzz -------------------------------------------------------------------------------- /en/Fritzing/Amplification.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Amplification.fzz -------------------------------------------------------------------------------- /en/Fritzing/AutomaticLightingSystem.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/AutomaticLightingSystem.fzz -------------------------------------------------------------------------------- /en/Fritzing/Automatic_Lighting_System.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Automatic_Lighting_System.fzz -------------------------------------------------------------------------------- /en/Fritzing/Blink.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Blink.fzz -------------------------------------------------------------------------------- /en/Fritzing/Chaser_Lights.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Chaser_Lights.fzz -------------------------------------------------------------------------------- /en/Fritzing/Chaserlights.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Chaserlights.fzz -------------------------------------------------------------------------------- /en/Fritzing/Fading.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Fading.fzz -------------------------------------------------------------------------------- /en/Fritzing/FlipFlop.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/FlipFlop.fzz -------------------------------------------------------------------------------- /en/Fritzing/Fortuneteller.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Fortuneteller.fzz -------------------------------------------------------------------------------- /en/Fritzing/Fortuneteller2.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Fortuneteller2.fzz -------------------------------------------------------------------------------- /en/Fritzing/H-Bridge.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/H-Bridge.fzz -------------------------------------------------------------------------------- /en/Fritzing/Magic_Board.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Magic_Board.fzz -------------------------------------------------------------------------------- /en/Fritzing/Matrix.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Matrix.fzz -------------------------------------------------------------------------------- /en/Fritzing/Messen_Spannung.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Messen_Spannung.fzz -------------------------------------------------------------------------------- /en/Fritzing/Night_Light.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Night_Light.fzz -------------------------------------------------------------------------------- /en/Fritzing/Nightlight.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Nightlight.fzz -------------------------------------------------------------------------------- /en/Fritzing/Orakelwürfel_01.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Orakelwürfel_01.fzz -------------------------------------------------------------------------------- /en/Fritzing/Piezo_Synth_Sch.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Piezo_Synth_Sch.fzz -------------------------------------------------------------------------------- /en/Fritzing/Ping-Pong.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Ping-Pong.fzz -------------------------------------------------------------------------------- /en/Fritzing/Ping_Pong.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Ping_Pong.fzz -------------------------------------------------------------------------------- /en/Fritzing/Pingpong.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Pingpong.fzz -------------------------------------------------------------------------------- /en/Fritzing/Potentiometer.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Potentiometer.fzz -------------------------------------------------------------------------------- /en/Fritzing/Processing_RGB.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Processing_RGB.fzz -------------------------------------------------------------------------------- /en/Fritzing/Sandbox.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Sandbox.fzz -------------------------------------------------------------------------------- /en/Fritzing/SchematicsRref.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/SchematicsRref.fzz -------------------------------------------------------------------------------- /en/Fritzing/Servo.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Servo.fzz -------------------------------------------------------------------------------- /en/Fritzing/Synthesizer.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Synthesizer.fzz -------------------------------------------------------------------------------- /en/Fritzing/TwitterSaurus.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/TwitterSaurus.fzz -------------------------------------------------------------------------------- /en/Fritzing/Twitter_Saurus.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Twitter_Saurus.fzz -------------------------------------------------------------------------------- /en/Fritzing/Verstärkung.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Verstärkung.fzz -------------------------------------------------------------------------------- /en/Fritzing/Zaubertafel.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Fritzing/Zaubertafel.fzz -------------------------------------------------------------------------------- /en/Processing/RGB/RGB.pde: -------------------------------------------------------------------------------- 1 | import processing.serial.*; 2 | import cc.arduino.*; 3 | 4 | Arduino meinArduino; 5 | 6 | int potPin=0; 7 | int value; 8 | 9 | int redX = 20; 10 | int greenX = 20; 11 | int blueX = 20; 12 | 13 | int redPin = 9; 14 | int greenPin = 10; 15 | int bluePin = 11; 16 | 17 | int oldGreen; 18 | int oldRed; 19 | int oldBlue; 20 | 21 | void setup() { 22 | size(255,300,P3D); 23 | println(Serial.list()); // List all the available serial ports: 24 | meinArduino = new Arduino(this, Arduino.list()[4], 57600); 25 | noStroke(); 26 | } 27 | 28 | void graphics(int theValue){ 29 | colorMode(RGB,255); 30 | background(0); 31 | fill(100); 32 | rect(0,20,width,20); 33 | rect(0,60,width,20); 34 | rect(0,100,width,20); 35 | fill(255,0,0); rect(0,20,redX,20); 36 | fill(0,255,0); rect(0,60,greenX,20); 37 | fill(0,0,255); rect(0,100,blueX,20); 38 | colorMode(HSB, 100); 39 | fill(value,100,100); 40 | rect(0,160,width,height); 41 | } 42 | 43 | void draw(){ 44 | value=meinArduino.analogRead(potPin); 45 | value=(int)map(value,0,1023,0,100); 46 | if (mousePressed==true){ 47 | if ((mouseX>0)&&(mouseX<=width)){ 48 | if ((mouseY>20)&&(mouseY<40)) { 49 | redX = mouseX; 50 | } 51 | if ((mouseY>60)&&(mouseY<80)) { 52 | greenX = mouseX; 53 | } 54 | if ((mouseY>100)&&(mouseY<120)) { 55 | blueX = mouseX; 56 | } 57 | } 58 | } 59 | 60 | graphics(value); 61 | 62 | if (redX!=oldRed){ 63 | meinArduino.analogWrite(redPin,redX); 64 | oldRed=redX; 65 | } 66 | if (greenX!=oldGreen){ 67 | meinArduino.analogWrite(greenPin,greenX); 68 | oldGreen=greenX; 69 | } 70 | if (blueX!=oldBlue){ 71 | meinArduino.analogWrite(bluePin,blueX); 72 | oldBlue=blueX; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /en/Processing/TwitterSaurus/TwitterSaurus.pde: -------------------------------------------------------------------------------- 1 | import processing.serial.*; // Einbinden der Serial Programmbibliothek 2 | import cc.arduino.*; // Einbinden der Arduino Programmbibliothek 3 | import ddf.minim.*; // Einbinden der Minim Programmbibliothek für die Soundausgabe 4 | 5 | /* 6 | TwitterSaurus 7 | Dieses Programm sucht nach einem Suchbegriff auf Twitter. Wenn ein neuer Beitrag geschrieben wird, 8 | wird ein Sound ausgelöst und ein Servo dreht sich. Er bewegt das Maul des Dinosauriers des Fritzing Creator Kits. 9 | 10 | Dieses Beispiel aus dem Fritzing Creator Kit: www.fritzing.org/creator-kit. 11 | */ 12 | 13 | 14 | String myQuery="Dino"; // Begriff, nach dem gesucht werden soll 15 | 16 | Twitter twitter; // Erzeugt ein Twitter-Objekt 17 | Query query; // Erzeugt ein Query-Objekt 18 | Arduino arduino; // Erzeugt ein Arduino-Objekt 19 | Minim minim; // Erzeugt ein Minim-Objekt 20 | AudioSample sound1; // Erzeugt ein AudioSample-Objekt 21 | PFont font; // Erzeugt ein PFont-Objekt 22 | 23 | long timer; // Timer wird angelegt 24 | int timeout=1000; // Timeout – wie oft soll geprüft werden? 25 | 26 | String lastMessage=""; // speichert die letzte Twittermeldung 27 | String currentMessage=""; // speichert die aktuelle Twittermeldung 28 | 29 | TwitterFactory twitterFactory; // Erstelle ein Twitter-Factory Objekt 30 | 31 | int servoPin=10; // Servo an Arduino-Pin 32 | 33 | void setup(){ 34 | size(400,200); // legt die Größe des Programmfensters fest 35 | ConfigurationBuilder cb = new ConfigurationBuilder(); // ConfigurationBuilder für Twitter 36 | cb.setOAuthConsumerKey("uzr17kGYqhgNDjTBNQd1qA"); // Hier muss Dein ConsumerKey eingegeben werden 37 | cb.setOAuthConsumerSecret("ZZUfCHruwv4d6Tn9uGz0UGebxfn4oQDikv3NeCbd14"); // Hier muss Dein ConsumerSecret eingegeben werden 38 | cb.setOAuthAccessToken("221060254-8MJIyVpXotDhemKaJKVN88L1FlCcndToB8y143LU"); // Hier muss Dein AccessToken eingegeben werden 39 | cb.setOAuthAccessTokenSecret("A2R7IkcSniMnBHYeRK02umHoIvrsHQAdx4NaMq6toY"); // Hier muss Dein AccessTokenSecret eingegeben werden 40 | 41 | twitterFactory = new TwitterFactory(cb.build()); // öffnet eine Verbindung zu Twitter 42 | twitter = twitterFactory.getInstance(); 43 | 44 | minim = new Minim(this); // Minim (Bibliothek für die Soundausgabe) wird initialisiert 45 | sound1 = minim.loadSample("sound1.wav"); // Sounddatei wird geladen 46 | font = loadFont("OCRAStd-14.vlw"); // Font-Datei wird geladen 47 | textFont(font); // Font wird initialisiert 48 | println(Arduino.list()); // Alle seriellen Geräte werden in einer Liste ausgegeben, die Nummer für das Arduino muss 49 | arduino = new Arduino(this, Arduino.list()[4]); // hier übergeben werden: Arduino.list()[nummer] 50 | arduino.pinMode(servoPin, Arduino.OUTPUT); // Servo Pin wird im Arduino als Output festgelegt 51 | } 52 | 53 | void alertMe(){ // Methode wird aufgerufen, wenn es eine neue Nachricht gibt 54 | sound1.trigger(); // Soundsample wird abgespielt 55 | arduino.analogWrite(servoPin, 120); // Servo wird gedreht 56 | delay(500); // warten 57 | arduino.analogWrite(servoPin, 20); // Servo wird gedreht 58 | delay(500); // warten 59 | } 60 | 61 | void twitterConnect(){ // Methode für die Verbindung zu Twitter 62 | try { // versuche 63 | Query query = new Query(myQuery); 64 | QueryResult result = twitter.search(query); 65 | for (Status status : result.getTweets()) { 66 | println("@" + status.getUser().getScreenName() + ":" + status.getText()); 67 | currentMessage="@" + status.getUser().getScreenName() + ":" + status.getText(); 68 | } 69 | } 70 | catch (TwitterException e) { // bei Fehler 71 | println("Couldn't connect: " + e); // Fehlermeldung wird ausgegeben 72 | }; 73 | } 74 | 75 | void draw(){ // draw Methode ist wie loop in Arduino 76 | if (millis()>timer+timeout){ // wenn wartezeit vorüber 77 | twitterConnect(); // Methodenaufruf 78 | timer=millis(); // timer wird neu gestartet 79 | } 80 | 81 | if (currentMessage.equals(lastMessage) == false) { // wenn aktuelle Nachricht anders als letzte Nachricht ist 82 | background(0); // Hindergrund füllen 83 | text(currentMessage, 10, 20,width-20,height-40); // Tweet als Text ausgeben 84 | alertMe(); // Methodenaufruf 85 | lastMessage=currentMessage; // letzteNachricht auf aktuelle Nachricht senden 86 | } 87 | } 88 | 89 | -------------------------------------------------------------------------------- /en/Processing/TwitterSaurus/code/twitter4j-core-3.0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Processing/TwitterSaurus/code/twitter4j-core-3.0.3.jar -------------------------------------------------------------------------------- /en/Processing/TwitterSaurus/data/OCRAStd-14.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Processing/TwitterSaurus/data/OCRAStd-14.vlw -------------------------------------------------------------------------------- /en/Processing/TwitterSaurus/data/sound1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fritzing/creatorkit-code/7cca0fd7cf19570b6cf924916e0d4f7711a6ebcf/en/Processing/TwitterSaurus/data/sound1.wav -------------------------------------------------------------------------------- /en/Processing/TwitterSaurus2/TwitterSaurus2.pde: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Just a simple Processing and Twitter thingy majiggy 4 | 5 | RobotGrrl.com 6 | 7 | Code licensed under: 8 | CC-BY 9 | 10 | */ 11 | 12 | // First step is to register your Twitter application at dev.twitter.com 13 | // Once registered, you will have the info for the OAuth tokens 14 | // You can get the Access token info by clicking on the button on the 15 | // right on your twitter app's page 16 | // Good luck, and have fun! 17 | 18 | // This is where you enter your Oauth info 19 | static String OAuthConsumerKey = "uzr17kGYqhgNDjTBNQd1qA"; 20 | static String OAuthConsumerSecret = "ZZUfCHruwv4d6Tn9uGz0UGebxfn4oQDikv3NeCbd14"; 21 | 22 | // This is where you enter your Access Token info 23 | static String AccessToken = "221060254-8MJIyVpXotDhemKaJKVN88L1FlCcndToB8y143LU"; 24 | static String AccessTokenSecret = "A2R7IkcSniMnBHYeRK02umHoIvrsHQAdx4NaMq6toY"; 25 | 26 | // Just some random variables kicking around 27 | String myTimeline; 28 | java.util.List statuses = null; 29 | User[] friends; 30 | TwitterFactory twitterFactory; 31 | //Twitter twitter; 32 | 33 | Twitter twitter = TwitterFactory.getSingleton(); 34 | 35 | 36 | RequestToken requestToken; 37 | String[] theSearchTweets = new String[11]; 38 | 39 | 40 | 41 | void setup() { 42 | 43 | size(100,100); 44 | background(0); 45 | 46 | connectTwitter(); 47 | //sendTweet("Hey from Simple Processing woop woop #loadedsith #robotgirl"); 48 | //getTimeline(); 49 | getSearchTweets(); 50 | 51 | } 52 | 53 | 54 | void draw() { 55 | 56 | background(0); 57 | 58 | } 59 | 60 | 61 | // Initial connection 62 | void connectTwitter() { 63 | ConfigurationBuilder cb = new ConfigurationBuilder(); 64 | cb.setOAuthConsumerKey(OAuthConsumerKey); 65 | cb.setOAuthConsumerSecret( OAuthConsumerSecret ); 66 | cb.setOAuthAccessToken( AccessToken); 67 | cb.setOAuthAccessTokenSecret( AccessTokenSecret ); 68 | twitterFactory = new TwitterFactory(cb.build()); 69 | twitter = twitterFactory.getInstance(); 70 | println("connected"); 71 | } 72 | 73 | // Sending a tweet 74 | void sendTweet(String t) { 75 | 76 | try { 77 | Status status = twitter.updateStatus(t); 78 | println("Successfully updated the status to [" + status.getText() + "]."); 79 | } catch(TwitterException e) { 80 | println("Send tweet: " + e + " Status code: " + e.getStatusCode()); 81 | } 82 | 83 | } 84 | 85 | 86 | // Loading up the access token 87 | private static AccessToken loadAccessToken(){ 88 | return new AccessToken(AccessToken, AccessTokenSecret); 89 | } 90 | 91 | 92 | // Get your tweets 93 | void getTimeline() { 94 | 95 | try { 96 | statuses = twitter.getUserTimeline(); 97 | } catch(TwitterException e) { 98 | println("Get timeline: " + e + " Status code: " + e.getStatusCode()); 99 | } 100 | 101 | for(int i=0; i