Pārlūkot izejas kodu

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

Thomas Buck 12 gadus atpakaļ
vecāks
revīzija
94daa9c742
5 mainītis faili ar 50 papildinājumiem un 46 dzēšanām
  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 Parādīt failu

@@ -563,8 +563,9 @@ public class Frame extends JFrame implements ListSelectionListener {
563 563
 				} else {
564 564
 					for (int i = 0; i < frameList.getModel().getSize(); i++){
565 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 569
 						try {
569 570
 							Thread.sleep(time);
570 571
 						} catch (Exception e) {
@@ -623,7 +624,7 @@ public class Frame extends JFrame implements ListSelectionListener {
623 624
 						errorMessage("Please select a Frame!");
624 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 Parādīt failu

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

+ 1
- 1
CubeFirmware/makefile Parādīt failu

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

+ 1
- 0
CubeFirmware/memLayer.c Parādīt failu

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

+ 32
- 36
Hardware/Parts.txt Parādīt failu

@@ -1,44 +1,40 @@
1 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 40
 	https://secure.reichelt.de/index.html?;ACTION=20;AWKID=538158;PROVID=2084

Notiek ielāde…
Atcelt
Saglabāt