Browse Source

Fixed duration (hutattedonmyarm), fixed playing (hutattedonmyarm), fixed other stuff (xythobuz)

Thomas Buck 12 years ago
parent
commit
94daa9c742
5 changed files with 50 additions and 46 deletions
  1. 4
    3
      CubeControl/Frame.java
  2. 12
    6
      CubeFirmware/main.c
  3. 1
    1
      CubeFirmware/makefile
  4. 1
    0
      CubeFirmware/memLayer.c
  5. 32
    36
      Hardware/Parts.txt

+ 4
- 3
CubeControl/Frame.java View File

563
 				} else {
563
 				} else {
564
 					for (int i = 0; i < frameList.getModel().getSize(); i++){
564
 					for (int i = 0; i < frameList.getModel().getSize(); i++){
565
 						frameList.setSelectedIndex(i);
565
 						frameList.setSelectedIndex(i);
566
-						short time1 = worker.getAnimation(animList.getSelectedIndex()).getFrame(frameList.getSelectedIndex()).getTime();
567
-						long time = (long) (((time1+1) * 1/24) * 1000);
566
+						long time1 = (long) worker.getAnimation(animList.getSelectedIndex()).getFrame(frameList.getSelectedIndex()).getTime();
567
+						long time = (long) (((time1+1) * 1000) / 24);
568
+						System.out.println("Wert: " + time1 + " Zeit: " + time);
568
 						try {
569
 						try {
569
 							Thread.sleep(time);
570
 							Thread.sleep(time);
570
 						} catch (Exception e) {
571
 						} catch (Exception e) {
623
 						errorMessage("Please select a Frame!");
624
 						errorMessage("Please select a Frame!");
624
 						return;
625
 						return;
625
 					}
626
 					}
626
-					worker.getAnimation(animList.getSelectedIndex()).getFrame(frameList.getSelectedIndex()).setTime((byte)(Integer.parseInt(frameLengthText.getText()) - 1));
627
+					worker.getAnimation(animList.getSelectedIndex()).getFrame(frameList.getSelectedIndex()).setTime((byte)(Integer.parseInt(frameLengthText.getText())));
627
 				}
628
 				}
628
 			}
629
 			}
629
 		});
630
 		});

+ 12
- 6
CubeFirmware/main.c View File

30
 
30
 
31
 #define VERSION "8^3 LED-Cube v1\n"
31
 #define VERSION "8^3 LED-Cube v1\n"
32
 
32
 
33
-#define DEBUG
34
-
35
 #include <avr/io.h>
33
 #include <avr/io.h>
36
 #include <util/delay.h>
34
 #include <util/delay.h>
37
 #include <avr/interrupt.h>
35
 #include <avr/interrupt.h>
97
 	lastChecked = getSystemTime();
95
 	lastChecked = getSystemTime();
98
 
96
 
99
 	while (1) {
97
 	while (1) {
100
-		if(lastMode) {
98
+		//if(lastMode) {
101
 			// Get Audio Data and visualize it
99
 			// Get Audio Data and visualize it
102
 			/* audioData = getAudioData();
100
 			/* audioData = getAudioData();
103
 			if (audioData != NULL) {
101
 			if (audioData != NULL) {
106
 				free(audioData);
104
 				free(audioData);
107
 			}
105
 			}
108
 			while(!isFinished()); // Wait for it to display */
106
 			while(!isFinished()); // Wait for it to display */
109
-		} else {
107
+		//} else {
110
 			// Look for commands, play from fram
108
 			// Look for commands, play from fram
111
 			// We have 128*1024 bytes
109
 			// We have 128*1024 bytes
112
 			// A Frame needs 65 bytes (64 data + duration)
110
 			// A Frame needs 65 bytes (64 data + duration)
122
 				count = getAnimationCount();
120
 				count = getAnimationCount();
123
 				refreshAnimationCount = 0;
121
 				refreshAnimationCount = 0;
124
 			} */
122
 			} */
125
-		}
123
+		//}
126
 
124
 
127
 		if ((getSystemTime() - lastChecked) > 100) {
125
 		if ((getSystemTime() - lastChecked) > 100) {
128
 			lastMode = audioModeSelected();
126
 			lastMode = audioModeSelected();
136
 
134
 
137
 void serialHandler(char c) {
135
 void serialHandler(char c) {
138
 	// Used letters:
136
 	// Used letters:
139
-	// a, c, d, g, s, t, v
137
+	// a, c, d, g, s, t, v, x
140
 	switch(c) {
138
 	switch(c) {
141
 	case OK:
139
 	case OK:
142
 		serialWrite(OK);
140
 		serialWrite(OK);
190
 		serialWriteString(" Frames stored\n");
188
 		serialWriteString(" Frames stored\n");
191
 		break;
189
 		break;
192
 
190
 
191
+	case 'x': case 'X':
192
+		// Get byte, store as animation count
193
+		serialWriteString("Send a byte...");
194
+		while (!serialHasChar());
195
+		setAnimationCount(serialGet());
196
+		serialWriteString(" Byte written!\n");
197
+		break;
198
+
193
 	case '\n':
199
 	case '\n':
194
 		serialWriteString(VERSION);
200
 		serialWriteString(VERSION);
195
 		serialWriteString("See xythobuz.org for more Infos!\n");
201
 		serialWriteString("See xythobuz.org for more Infos!\n");

+ 1
- 1
CubeFirmware/makefile View File

78
 CSTANDARD = -std=gnu99
78
 CSTANDARD = -std=gnu99
79
 
79
 
80
 # Place -D or -U options here
80
 # Place -D or -U options here
81
-CDEFS =
81
+CDEFS = -D DEBUG
82
 
82
 
83
 # Place -I options here
83
 # Place -I options here
84
 CINCS =
84
 CINCS =

+ 1
- 0
CubeFirmware/memLayer.c View File

25
  #include <stdlib.h>
25
  #include <stdlib.h>
26
  #include "mem.h"
26
  #include "mem.h"
27
  #include "memLayer.h"
27
  #include "memLayer.h"
28
+ #include "serial.h"
28
 
29
 
29
 // Free after usage!
30
 // Free after usage!
30
 uint8_t *getFrame(uint16_t frameNumber) {
31
 uint8_t *getFrame(uint16_t frameNumber) {

+ 32
- 36
Hardware/Parts.txt View File

1
 Partlist
1
 Partlist
2
 
2
 
3
-Quantity Value          Device          Package        Library             Bought?
3
+Quant.	Value			Device
4
 
4
 
5
-// Capacitors
6
-22       100n           C-EUC0603       C0603          resistor            Yes
7
-4        22p            C-EUC0603       C0603          resistor            Yes
8
-1        4u7            C-EUC0603       C0603          resistor            Yes
9
-1        33p            C-EUC0603       C0603          resistor            Yes
10
-1        10n            C-EUC0603       C0603          resistor            Yes
11
-1        4u7            CPOL-EUTAP5-80  TAP5-80        resistor            Yes
5
+22		100nF			0603
6
+4		22pF			0603
7
+1		4u7F			0603
8
+1		33pF			0603
9
+1		10nF			0603
10
+1		100uF			CPOL-80
12
 
11
 
13
-// Resistors
14
-8        15             R-EU_R0603      R0603          resistor            Yes
15
-3        10k            R-EU_R0603      R0603          resistor            Yes
16
-8        100k           R-EU_R0603      R0603          resistor            Yes
17
-67       1k             R-EU_R0603      R0603          resistor            Yes
18
-3        200k           R-EU_R0603      R0603          resistor            Yes
19
-2        2k             R-EU_R0603      R0603          resistor            Yes
20
-1        4k7            R-EU_R0603      R0603          resistor            Yes
21
-64       112.5			0603			0603                               Yes
12
+8		15R				0603
13
+3		10kR			0603
14
+8		100kR			0603
15
+67		1kR				0603
16
+3		200kR			0603
17
+2		2kR				0603
18
+1		4k7R			0603
19
+64		120R			0603
22
 
20
 
23
-// IC
24
-64       PNP            PNP             SOT323         0-xythobuz          Yes
25
-8        IRF530         IRF530          TO220-3V       0-xythobuz          Yes
26
-8        74HC573D       74HC573D        SO20W          74xx-eu             Yes
27
-1        MEGA8-AI       MEGA8-AI        TQFP32-08      atmel               Yes
28
-1        FT232RL        FT232RL         SSOP28         ftdichip            Yes
29
-1        FM24V10        FM24V10         SOIC8          0-xythobuz          Yes
30
-1        MSGEQ7         MSGEQ7          DIP8           0-xythobuz          Yes
31
-1        7805           78XXS           78XXS          v-reg               Yes
32
-1        MEGA32-A       MEGA32-A        TQFP44         atmel               Yes
21
+64		PNP				PNP
22
+8		IRF530			IRF530
23
+8		74HC573D		74HC573D
24
+1		MEGA8-AI		MEGA8-AI
25
+1		FT232RL			FT232RL
26
+1		FM24V10			FM24V10
27
+1		MSGEQ7			MSGEQ7
28
+1		7805			78XXS
29
+1		MEGA32-A		MEGA32-A
33
 
30
 
34
-// Misc
35
-1        POTI           TRIM_EU-PT10S   PT-10S         pot                 Yes
36
-1        Connector      ML64            ML64           con-ml              Yes
37
-1        KLINKENBUCHSE  KLINKENBUCHSE   KLINKEPRINT    0-xythobuz          Yes
38
-1        TASTER         TASTER          SMDTASTER      0-xythobuz          Yes
39
-1        DC-Stecker     733980-62       733980-62      con-conrad          Yes
40
-1        USB-B mini     USB-B-MINI-SMD  USB-B-MINI-SMD 1_USER              Yes
31
+1		POTI			TRIM_EU-PT
32
+1		Connector		ML64
33
+1		Klinkenbuchse	Klinkenbuchse
34
+1		TASTER			TASTER	SMD
35
+1		DC-Stecker		733980-62
36
+1		USB-B mini		USB-B-MINI-SMD
41
 
37
 
42
-==> Ohne Versand: 48,63€ / 3 = 16,21€ pro Person
43
-	Gespeichert in myReichelt.
38
+==>	48,63€
39
+	Reichelt:
44
 	https://secure.reichelt.de/index.html?;ACTION=20;AWKID=538158;PROVID=2084
40
 	https://secure.reichelt.de/index.html?;ACTION=20;AWKID=538158;PROVID=2084

Loading…
Cancel
Save