Browse Source

Added Initial Cube Control Source

Thomas Buck 12 years ago
parent
commit
b9c9cf9b04
5 changed files with 792 additions and 1 deletions
  1. BIN
      .DS_Store
  2. 119
    0
      Cube Control/cubeWorker.java
  3. 417
    0
      Cube Control/frame.java
  4. 252
    0
      Cube Control/frame.jfm
  5. 4
    1
      main.c

BIN
.DS_Store View File


+ 119
- 0
Cube Control/cubeWorker.java View File

@@ -0,0 +1,119 @@
1
+public class cubeWorker {
2
+
3
+    cubeWorker() {
4
+
5
+    }
6
+
7
+    // Adds a new Animation
8
+    // Returns id if ok, -1 if error or not enough space for
9
+    // another animation
10
+    public int addAnimation() {
11
+
12
+           return -1;
13
+    }
14
+    
15
+    // Removes an animation
16
+    public void removeAnimation(int index) {
17
+
18
+    }
19
+    
20
+    // Returns how many animations are defined
21
+    public int numOfAnimations() {
22
+
23
+           return 0;
24
+    }
25
+    
26
+    // Selects an animation, on wich the frame specific functions operate
27
+    // Returns -1 if it does not exist
28
+    public int selectAnimation(int index) {
29
+
30
+           return -1;
31
+    }
32
+    
33
+    public String getAnimationName(int index) {
34
+
35
+           return "Test";
36
+    }
37
+    
38
+    public void setAnimationName(int index, String s) {
39
+
40
+    }
41
+    
42
+    // Returns how many frames are in the current animation
43
+    public int numOfFrames() {
44
+
45
+           return 0;
46
+    }
47
+    
48
+    public String getFrameName(int index) {
49
+
50
+           return "Test";
51
+    }
52
+
53
+    public void setFrameName(int index, String s) {
54
+
55
+    }
56
+    
57
+    // Adds a Frame to the current animation.
58
+    // Returns id if okay, -1 if error
59
+    public int addFrame() {
60
+
61
+           return -1;
62
+    }
63
+    
64
+    // Remove a frame
65
+    public void removeFrame(int index) {
66
+
67
+    }
68
+    
69
+    // Returns array with 64 bytes with led values
70
+    public byte[] getFrame(int index) {
71
+
72
+           return null;
73
+    }
74
+    
75
+    public void setFrame(int index, byte[] data) {
76
+
77
+    }
78
+    
79
+    // Loads an animation file into this object
80
+    public int loadState(String path) {
81
+
82
+           return 0;
83
+    }
84
+    
85
+    // Saves the state of this object in an animation file
86
+    public int saveState(String path) {
87
+           System.out.println("Saving to " + path);
88
+           return 0;
89
+    }
90
+    
91
+    // sends state of object to led cube
92
+    public int uploadState(String port) {
93
+
94
+           return 0;
95
+    }
96
+    
97
+    // loads all state from the cube into this object
98
+    public int downloadState(String port) {
99
+
100
+           return 0;
101
+    }
102
+    
103
+    // Tells how many Frames you can add until you reached 1 Mbit...
104
+    public int framesRemaining() {
105
+
106
+           return 0;
107
+    }
108
+    
109
+    public String[] getSerialPorts() {
110
+
111
+           return null;
112
+    }
113
+    
114
+    // Returns true if last saved state != current state
115
+    public boolean changedStateSinceSave() {
116
+
117
+           return false;
118
+    }
119
+}

+ 417
- 0
Cube Control/frame.java View File

@@ -0,0 +1,417 @@
1
+import java.awt.*;
2
+import java.awt.event.*;
3
+import javax.swing.*;
4
+
5
+/**
6
+  *
7
+  * Beschreibung
8
+  *
9
+  * @version 1.0 vom 14.11.2011
10
+  * @author
11
+  */
12
+
13
+public class frame extends JFrame {
14
+  // Anfang Variablen
15
+  private Canvas cubeCanvas = new Canvas();
16
+  private JButton editA = new JButton();
17
+  private JButton editB = new JButton();
18
+  private JButton editC = new JButton();
19
+  private JButton editD = new JButton();
20
+  private JButton editE = new JButton();
21
+  private JButton editF = new JButton();
22
+  private JButton editG = new JButton();
23
+  private JButton editH = new JButton();
24
+  private DefaultListModel frameListModel = new DefaultListModel();
25
+  private JList frameList = new JList(frameListModel);
26
+  private JButton frameUp = new JButton();
27
+  private JButton frameDown = new JButton();
28
+  private JButton frameAdd = new JButton();
29
+  private JButton frameRemove = new JButton();
30
+  private DefaultListModel animationListModel = new DefaultListModel();
31
+  private JList jList2 = new JList(animationListModel);
32
+  private JButton animUp = new JButton();
33
+  private JButton animDown = new JButton();
34
+  private JButton animAdd = new JButton();
35
+  private JButton animRemove = new JButton();
36
+  private JTextField animPath = new JTextField();
37
+  private JButton load = new JButton();
38
+  private JButton save = new JButton();
39
+  private String[] jComboBox1Daten = {"Select serial port..."};
40
+  private JComboBox jComboBox1 = new JComboBox(jComboBox1Daten);
41
+  private JButton upload = new JButton();
42
+  private JButton download = new JButton();
43
+  private JLabel jLabel4 = new JLabel();
44
+  private JTextField frameRemaining = new JTextField();
45
+  
46
+  private cubeWorker worker = new cubeWorker();
47
+  // Ende Variablen
48
+
49
+  private int saveExitDialog() {
50
+    String[] Optionen = {"Yes", "No"};
51
+    int Auswahl = JOptionPane.showOptionDialog(this, "Save?", "Yes/No", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, Optionen, Optionen[0]);
52
+    if (Auswahl == JOptionPane.YES_OPTION) {
53
+       worker.saveState(animPath.getText());
54
+       return 1;
55
+    } else {
56
+       return 0;
57
+    }
58
+  }
59
+
60
+  public frame(String title) {
61
+    // Frame-Initialisierung
62
+    super(title);
63
+
64
+    frameListModel.add(0, "Frame 1");
65
+    frameListModel.add(1, "Frame 2");
66
+    frameListModel.add(2, "Frame 3");
67
+    animationListModel.add(0, "Animation 1");
68
+    animationListModel.add(1, "Animation 2");
69
+    animationListModel.add(2, "Animation 3");
70
+
71
+    addWindowListener(new WindowAdapter() {
72
+      public void windowClosing(WindowEvent evt) {
73
+             if (worker.changedStateSinceSave()) {
74
+                  saveExitDialog();
75
+             }
76
+             System.exit(0);
77
+      }
78
+    });
79
+    int frameWidth = 662;
80
+    int frameHeight = 416;
81
+    setSize(frameWidth, frameHeight);
82
+    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
83
+    int x = (d.width - getSize().width) / 2;
84
+    int y = (d.height - getSize().height) / 2 ;
85
+    setLocation(x, y);
86
+    Container cp = getContentPane();
87
+    cp.setLayout(null);
88
+    // Anfang Komponenten
89
+
90
+    cubeCanvas.setBounds(8, 8, 250, 250);
91
+    cubeCanvas.setBackground(Color.GRAY);
92
+    cp.add(cubeCanvas);
93
+    editA.setBounds(264, 8, 107, 25);
94
+    editA.setText("Layer A");
95
+    cp.add(editA);
96
+    editA.addActionListener(new ActionListener() {
97
+      public void actionPerformed(ActionEvent evt) {
98
+        editAActionPerformed(evt);
99
+      }
100
+    });
101
+
102
+    editB.setBounds(264, 40, 107, 25);
103
+    editB.setText("Layer B");
104
+    cp.add(editB);
105
+    editB.addActionListener(new ActionListener() {
106
+      public void actionPerformed(ActionEvent evt) {
107
+        editBActionPerformed(evt);
108
+      }
109
+    });
110
+
111
+    editC.setBounds(264, 72, 107, 25);
112
+    editC.setText("Layer C");
113
+    cp.add(editC);
114
+    editC.addActionListener(new ActionListener() {
115
+      public void actionPerformed(ActionEvent evt) {
116
+        editCActionPerformed(evt);
117
+      }
118
+    });
119
+
120
+    editD.setBounds(264, 104, 107, 25);
121
+    editD.setText("Layer D");
122
+    cp.add(editD);
123
+    editD.addActionListener(new ActionListener() {
124
+      public void actionPerformed(ActionEvent evt) {
125
+        editDActionPerformed(evt);
126
+      }
127
+    });
128
+
129
+    editE.setBounds(264, 136, 107, 25);
130
+    editE.setText("Layer E");
131
+    cp.add(editE);
132
+    editE.addActionListener(new ActionListener() {
133
+      public void actionPerformed(ActionEvent evt) {
134
+        editEActionPerformed(evt);
135
+      }
136
+    });
137
+
138
+    editF.setBounds(264, 168, 107, 25);
139
+    editF.setText("Layer F");
140
+    cp.add(editF);
141
+    editF.addActionListener(new ActionListener() {
142
+      public void actionPerformed(ActionEvent evt) {
143
+        editFActionPerformed(evt);
144
+      }
145
+    });
146
+
147
+    editG.setBounds(264, 200, 107, 25);
148
+    editG.setText("Layer G");
149
+    cp.add(editG);
150
+    editG.addActionListener(new ActionListener() {
151
+      public void actionPerformed(ActionEvent evt) {
152
+        editGActionPerformed(evt);
153
+      }
154
+    });
155
+
156
+    editH.setBounds(264, 232, 107, 25);
157
+    editH.setText("Layer H");
158
+    cp.add(editH);
159
+    editH.addActionListener(new ActionListener() {
160
+      public void actionPerformed(ActionEvent evt) {
161
+        editHActionPerformed(evt);
162
+      }
163
+    });
164
+
165
+    frameList.setBounds(384, 8, 145, 249);
166
+    cp.add(frameList);
167
+    frameUp.setBounds(544, 8, 107, 33);
168
+    frameUp.setText("Move up");
169
+    cp.add(frameUp);
170
+    frameUp.addActionListener(new ActionListener() {
171
+      public void actionPerformed(ActionEvent evt) {
172
+        frameUpActionPerformed(evt);
173
+      }
174
+    });
175
+
176
+    frameDown.setBounds(544, 152, 107, 33);
177
+    frameDown.setText("Move down");
178
+    cp.add(frameDown);
179
+    frameDown.addActionListener(new ActionListener() {
180
+      public void actionPerformed(ActionEvent evt) {
181
+        frameDownActionPerformed(evt);
182
+      }
183
+    });
184
+
185
+    frameAdd.setBounds(544, 56, 107, 33);
186
+    frameAdd.setText("Add");
187
+    cp.add(frameAdd);
188
+    frameAdd.addActionListener(new ActionListener() {
189
+      public void actionPerformed(ActionEvent evt) {
190
+        frameAddActionPerformed(evt);
191
+      }
192
+    });
193
+
194
+    frameRemove.setBounds(544, 104, 107, 33);
195
+    frameRemove.setText("Remove");
196
+    cp.add(frameRemove);
197
+    frameRemove.addActionListener(new ActionListener() {
198
+      public void actionPerformed(ActionEvent evt) {
199
+        frameRemoveActionPerformed(evt);
200
+      }
201
+    });
202
+
203
+    jList2.setBounds(8, 264, 209, 121);
204
+    cp.add(jList2);
205
+    animUp.setBounds(224, 264, 99, 25);
206
+    animUp.setText("Move up");
207
+    cp.add(animUp);
208
+    animUp.addActionListener(new ActionListener() {
209
+      public void actionPerformed(ActionEvent evt) {
210
+        animUpActionPerformed(evt);
211
+      }
212
+    });
213
+
214
+    animDown.setBounds(224, 360, 99, 25);
215
+    animDown.setText("Move down");
216
+    cp.add(animDown);
217
+    animDown.addActionListener(new ActionListener() {
218
+      public void actionPerformed(ActionEvent evt) {
219
+        animDownActionPerformed(evt);
220
+      }
221
+    });
222
+
223
+    animAdd.setBounds(224, 296, 99, 25);
224
+    animAdd.setText("Add");
225
+    cp.add(animAdd);
226
+    animAdd.addActionListener(new ActionListener() {
227
+      public void actionPerformed(ActionEvent evt) {
228
+        animAddActionPerformed(evt);
229
+      }
230
+    });
231
+
232
+    animRemove.setBounds(224, 328, 99, 25);
233
+    animRemove.setText("Remove");
234
+    cp.add(animRemove);
235
+    animRemove.addActionListener(new ActionListener() {
236
+      public void actionPerformed(ActionEvent evt) {
237
+        animRemoveActionPerformed(evt);
238
+      }
239
+    });
240
+
241
+    animPath.setBounds(344, 264, 305, 24);
242
+    animPath.setEditable(false);
243
+    animPath.setText("Load/Save an animation file...");
244
+    cp.add(animPath);
245
+    load.setBounds(344, 296, 147, 25);
246
+    load.setText("Load");
247
+    cp.add(load);
248
+    load.addActionListener(new ActionListener() {
249
+      public void actionPerformed(ActionEvent evt) {
250
+        loadActionPerformed(evt);
251
+      }
252
+    });
253
+
254
+    save.setBounds(504, 296, 147, 25);
255
+    save.setText("Save");
256
+    cp.add(save);
257
+    save.addActionListener(new ActionListener() {
258
+      public void actionPerformed(ActionEvent evt) {
259
+        saveActionPerformed(evt);
260
+      }
261
+    });
262
+
263
+    jComboBox1.setBounds(344, 328, 305, 24);
264
+    cp.add(jComboBox1);
265
+    upload.setBounds(344, 360, 147, 25);
266
+    upload.setText("Upload");
267
+    cp.add(upload);
268
+    upload.addActionListener(new ActionListener() {
269
+      public void actionPerformed(ActionEvent evt) {
270
+        uploadActionPerformed(evt);
271
+      }
272
+    });
273
+
274
+    download.setBounds(504, 360, 147, 25);
275
+    download.setText("Download");
276
+    cp.add(download);
277
+    download.addActionListener(new ActionListener() {
278
+      public void actionPerformed(ActionEvent evt) {
279
+        downloadActionPerformed(evt);
280
+      }
281
+    });
282
+
283
+    jLabel4.setBounds(536, 208, 111, 16);
284
+    jLabel4.setText("Frames remaining:");
285
+    jLabel4.setFont(new Font("MS Sans Serif", Font.PLAIN, 13));
286
+    cp.add(jLabel4);
287
+    frameRemaining.setBounds(536, 232, 113, 24);
288
+    frameRemaining.setEditable(false);
289
+    frameRemaining.setText("2048");
290
+    cp.add(frameRemaining);
291
+    // Ende Komponenten
292
+
293
+    setResizable(false);
294
+    setVisible(true);
295
+  }
296
+
297
+  // Anfang Ereignisprozeduren
298
+  public void editAActionPerformed(ActionEvent evt) {
299
+
300
+  }
301
+
302
+  public void editBActionPerformed(ActionEvent evt) {
303
+
304
+  }
305
+
306
+  public void editCActionPerformed(ActionEvent evt) {
307
+
308
+  }
309
+
310
+  public void editDActionPerformed(ActionEvent evt) {
311
+
312
+  }
313
+
314
+  public void editEActionPerformed(ActionEvent evt) {
315
+
316
+  }
317
+
318
+  public void editFActionPerformed(ActionEvent evt) {
319
+
320
+  }
321
+
322
+  public void editGActionPerformed(ActionEvent evt) {
323
+
324
+  }
325
+
326
+  public void editHActionPerformed(ActionEvent evt) {
327
+
328
+  }
329
+
330
+  public void frameUpActionPerformed(ActionEvent evt) {
331
+         int i = frameList.getSelectedIndex();
332
+         if ((i > 0) && (frameListModel.getSize() >= 2)) {
333
+            Object tmp = frameListModel.get(i);
334
+            frameListModel.set(i, frameListModel.get(i - 1));
335
+            frameListModel.set(i - 1, tmp);
336
+            frameList.setSelectedIndex(i - 1);
337
+         }
338
+  }
339
+
340
+  public void frameDownActionPerformed(ActionEvent evt) {
341
+         int i = frameList.getSelectedIndex();
342
+         if ((i >= 0) && (frameListModel.getSize() >= 2) && (i < (frameListModel.getSize() - 1))) {
343
+            Object tmp = frameListModel.get(i);
344
+            frameListModel.set(i, frameListModel.get(i + 1));
345
+            frameListModel.set(i + 1, tmp);
346
+            frameList.setSelectedIndex(i + 1);
347
+         }
348
+  }
349
+
350
+  public void frameAddActionPerformed(ActionEvent evt) {
351
+
352
+  }
353
+
354
+  public void frameRemoveActionPerformed(ActionEvent evt) {
355
+
356
+  }
357
+
358
+  public void animUpActionPerformed(ActionEvent evt) {
359
+         int i = jList2.getSelectedIndex();
360
+         if ((i > 0) && (animationListModel.getSize() >= 2)) {
361
+            Object tmp = animationListModel.get(i);
362
+            animationListModel.set(i, animationListModel.get(i - 1));
363
+            animationListModel.set(i - 1, tmp);
364
+            jList2.setSelectedIndex(i - 1);
365
+         }
366
+  }
367
+
368
+  public void animDownActionPerformed(ActionEvent evt) {
369
+         int i = jList2.getSelectedIndex();
370
+         if ((i >= 0) && (animationListModel.getSize() >= 2) && (i < (animationListModel.getSize() - 1))) {
371
+            Object tmp = animationListModel.get(i);
372
+            animationListModel.set(i, animationListModel.get(i + 1));
373
+            animationListModel.set(i + 1, tmp);
374
+            jList2.setSelectedIndex(i + 1);
375
+         }
376
+  }
377
+
378
+  public void animAddActionPerformed(ActionEvent evt) {
379
+
380
+  }
381
+
382
+  public void animRemoveActionPerformed(ActionEvent evt) {
383
+
384
+  }
385
+
386
+  public void loadActionPerformed(ActionEvent evt) {
387
+
388
+  }
389
+
390
+  public void saveActionPerformed(ActionEvent evt) {
391
+
392
+  }
393
+
394
+
395
+  public void uploadActionPerformed(ActionEvent evt) {
396
+         if (jComboBox1.getSelectedItem().equals("Select serial port...")) {
397
+            JOptionPane.showMessageDialog(this, "No serial port selected...");
398
+         } else {
399
+           worker.uploadState((String)jComboBox1.getSelectedItem());
400
+         }
401
+  }
402
+
403
+  public void downloadActionPerformed(ActionEvent evt) {
404
+         if (jComboBox1.getSelectedItem().equals("Select serial port...")) {
405
+            JOptionPane.showMessageDialog(this, "No serial port selected...");
406
+         } else {
407
+           worker.downloadState((String)jComboBox1.getSelectedItem());
408
+         }
409
+  }
410
+
411
+  // Ende Ereignisprozeduren
412
+
413
+  public static void main(String[] args) {
414
+    new frame("Cube Control");
415
+  }
416
+}
417
+

+ 252
- 0
Cube Control/frame.jfm View File

@@ -0,0 +1,252 @@
1
+object frame: TFGUIFormular
2
+  Left = 1
3
+  Top = 3
4
+  Width = 662
5
+  Height = 416
6
+  BorderIcons = [biSystemMenu, biMinimize]
7
+  Caption = 'H:\CT\cube\frame.jfm'
8
+  Color = clBtnFace
9
+  Font.Charset = DEFAULT_CHARSET
10
+  Font.Color = clWindowText
11
+  Font.Height = -13
12
+  Font.Name = 'MS Sans Serif'
13
+  Font.Style = []
14
+  FormStyle = fsMDIChild
15
+  OldCreateOrder = True
16
+  Visible = True
17
+  OnActivate = FormActivate
18
+  OnClose = FormClose
19
+  OnCloseQuery = FormCloseQuery
20
+  OnResize = FormResize
21
+  PixelsPerInch = 96
22
+  TextHeight = 16
23
+  object jLabel4: TLabel
24
+    Left = 536
25
+    Top = 208
26
+    Width = 111
27
+    Height = 16
28
+    Caption = 'Frames remaining:'
29
+  end
30
+  object cubeCanvas: TPanel
31
+    Left = 8
32
+    Top = 8
33
+    Width = 250
34
+    Height = 250
35
+    Caption = 'cubeCanvas'
36
+    Color = clGray
37
+    TabOrder = 0
38
+  end
39
+  object editA: TButton
40
+    Left = 264
41
+    Top = 8
42
+    Width = 107
43
+    Height = 25
44
+    Caption = 'Layer A'
45
+    TabOrder = 1
46
+  end
47
+  object editB: TButton
48
+    Left = 264
49
+    Top = 40
50
+    Width = 107
51
+    Height = 25
52
+    Caption = 'Layer B'
53
+    TabOrder = 2
54
+  end
55
+  object editC: TButton
56
+    Left = 264
57
+    Top = 72
58
+    Width = 107
59
+    Height = 25
60
+    Caption = 'Layer C'
61
+    TabOrder = 3
62
+  end
63
+  object editD: TButton
64
+    Left = 264
65
+    Top = 104
66
+    Width = 107
67
+    Height = 25
68
+    Caption = 'Layer D'
69
+    TabOrder = 4
70
+  end
71
+  object editE: TButton
72
+    Left = 264
73
+    Top = 136
74
+    Width = 107
75
+    Height = 25
76
+    Caption = 'Layer E'
77
+    TabOrder = 5
78
+  end
79
+  object editF: TButton
80
+    Left = 264
81
+    Top = 168
82
+    Width = 107
83
+    Height = 25
84
+    Caption = 'Layer F'
85
+    TabOrder = 6
86
+  end
87
+  object editG: TButton
88
+    Left = 264
89
+    Top = 200
90
+    Width = 107
91
+    Height = 25
92
+    Caption = 'Layer G'
93
+    TabOrder = 7
94
+  end
95
+  object editH: TButton
96
+    Left = 264
97
+    Top = 232
98
+    Width = 107
99
+    Height = 25
100
+    Caption = 'Layer H'
101
+    TabOrder = 8
102
+  end
103
+  object frameList: TListBox
104
+    Left = 384
105
+    Top = 8
106
+    Width = 145
107
+    Height = 249
108
+    ItemHeight = 16
109
+    Items.Strings = (
110
+      'Frame 1'
111
+      'Frame 2')
112
+    TabOrder = 9
113
+  end
114
+  object frameUp: TButton
115
+    Left = 544
116
+    Top = 8
117
+    Width = 107
118
+    Height = 33
119
+    Caption = 'Move up'
120
+    TabOrder = 10
121
+  end
122
+  object frameDown: TButton
123
+    Left = 544
124
+    Top = 152
125
+    Width = 107
126
+    Height = 33
127
+    Caption = 'Move down'
128
+    TabOrder = 11
129
+  end
130
+  object frameAdd: TButton
131
+    Left = 544
132
+    Top = 56
133
+    Width = 107
134
+    Height = 33
135
+    Caption = 'Add'
136
+    TabOrder = 12
137
+  end
138
+  object frameRemove: TButton
139
+    Left = 544
140
+    Top = 104
141
+    Width = 107
142
+    Height = 33
143
+    Caption = 'Remove'
144
+    TabOrder = 13
145
+  end
146
+  object jList2: TListBox
147
+    Left = 8
148
+    Top = 264
149
+    Width = 209
150
+    Height = 121
151
+    ItemHeight = 16
152
+    Items.Strings = (
153
+      'Animation 1'
154
+      'Animation 2')
155
+    TabOrder = 14
156
+  end
157
+  object animUp: TButton
158
+    Left = 224
159
+    Top = 264
160
+    Width = 99
161
+    Height = 25
162
+    Caption = 'Move up'
163
+    TabOrder = 15
164
+  end
165
+  object animDown: TButton
166
+    Left = 224
167
+    Top = 360
168
+    Width = 99
169
+    Height = 25
170
+    Caption = 'Move down'
171
+    TabOrder = 16
172
+  end
173
+  object animAdd: TButton
174
+    Left = 224
175
+    Top = 296
176
+    Width = 99
177
+    Height = 25
178
+    Caption = 'Add'
179
+    TabOrder = 17
180
+  end
181
+  object animRemove: TButton
182
+    Left = 224
183
+    Top = 328
184
+    Width = 99
185
+    Height = 25
186
+    Caption = 'Remove'
187
+    TabOrder = 18
188
+  end
189
+  object animPath: TEdit
190
+    Left = 344
191
+    Top = 264
192
+    Width = 305
193
+    Height = 24
194
+    Color = clBtnFace
195
+    Enabled = False
196
+    TabOrder = 19
197
+    Text = 'Load/Save an animation file...'
198
+  end
199
+  object load: TButton
200
+    Left = 344
201
+    Top = 296
202
+    Width = 147
203
+    Height = 25
204
+    Caption = 'Load'
205
+    TabOrder = 20
206
+  end
207
+  object save: TButton
208
+    Left = 504
209
+    Top = 296
210
+    Width = 147
211
+    Height = 25
212
+    Caption = 'Save'
213
+    TabOrder = 21
214
+  end
215
+  object jComboBox1: TComboBox
216
+    Left = 344
217
+    Top = 328
218
+    Width = 305
219
+    Height = 24
220
+    ItemHeight = 16
221
+    TabOrder = 22
222
+    Text = 'jComboBox1'
223
+    Items.Strings = (
224
+      'Select serial port...')
225
+  end
226
+  object upload: TButton
227
+    Left = 344
228
+    Top = 360
229
+    Width = 147
230
+    Height = 25
231
+    Caption = 'Upload'
232
+    TabOrder = 23
233
+  end
234
+  object download: TButton
235
+    Left = 504
236
+    Top = 360
237
+    Width = 147
238
+    Height = 25
239
+    Caption = 'Download'
240
+    TabOrder = 24
241
+  end
242
+  object frameRemaining: TEdit
243
+    Left = 536
244
+    Top = 232
245
+    Width = 113
246
+    Height = 24
247
+    Color = clBtnFace
248
+    Enabled = False
249
+    TabOrder = 25
250
+    Text = '2048'
251
+  end
252
+end

+ 4
- 1
main.c View File

@@ -67,7 +67,10 @@ int main(void) {
67 67
 	init();
68 68
 
69 69
 	while (1) {
70
-		
70
+		PORTB |= (1 << PB0);
71
+		_delay_ms(1000);
72
+		PORTB &= ~(1 << PB0);
73
+		_delay_ms(1000);
71 74
 	}
72 75
 	return 0;
73 76
 }

Loading…
Cancel
Save