BUG Community

Welcome! Log In

Forums Recent Posts

Subscribe to Recent Posts 12,498 posts found

Mar 31, 2008 11:27pm
Medium kschultz 107 posts

Topic: Java / Graphics Question

Hey,

I started working on an example for you. Got the static graphics going, the animation part is going to be harder. Do you want the BUG's location to update or just show the first time the app is launched statically? If you want them statically then just make a new class like the gridmarker one, but I had assumed you wanted it to update which is a bit more involved. I'll be working on that tomorrow.

Here is what it looks like at the moment:



And here is the code, the first two classes are the same as they would be for the bug, the last just the Frame to test stuff out


The canvas that you can draw on

import java.awt.Canvas;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Color;

public class ExampleCanvas extends Canvas {

public ExampleCanvas(Frame f) {
this.setBackground(Color.WHITE);
this.setSize(310, 210);

}

public void paint(Graphics g) {
for(int x = 0; x < 320; x+=25) {
for(int y = 0; y< 240; y +=25) {
new GridMarker(x,y,g);
}
}

}
}



This is the class for the little markers


package canvastest.app;

import java.awt.Graphics;
import java.awt.Color;

public class GridMarker {

private final int width = 7;
private final int height = 7;
private int x;
private int y;

public GridMarker(int x, int y, Graphics g) {
this.x = x;
this.y = y;
paint(g);
}

public void paint(Graphics g) {
g.setColor(Color.BLACK);
g.drawLine(x-width/2, y, x+width/2, y);
g.drawLine(x, y-height/2, x, y+height/2);
}
}


The main class, this would be your app that gets called from the servicetracker on the BUG, I am just doing it as a vanilla Java app
for no particular reason


package canvastest.app;

import java.awt.Frame;
import canvastest.app.ExampleCanvas;

public class CanvasTestMain {

/**
* @param args
*/
public static void main(String[] args) {
createUI();
}

private static void createUI() {
Frame frame = new Frame("CanvasTest");
frame.setSize(320, 240);
frame.setResizable(false);

ExampleCanvas canvas = new ExampleCanvas(frame);

frame.add(canvas);

frame.show();
}

}
Mar 31, 2008 8:03pm
g0pher 2 posts

Topic: Meet & Greet / Hi from the UK

Hi all! Greetings from Bristol UK

I am a product design student / dabbler in programming / hacker of anything. just so that you all know!

saw this, and thought it looked pretty fresh.. =]

Mar 31, 2008 8:00pm
g0pher 2 posts

Topic: BUGmodules / Some ideas for modules.. (a rather long list!)

firstly, hi forum! This is my first post here btw..

Here are a few of my ideas:


Wireless 'signal'/network system
, this would work via a 802.11 wifi signal, and send simple commands to other bug mainboards

exterior inputs / triggers module
. this would be a set of external connectors that can be wired up to an external circuit. They are then programmed to respond to specific changes in the state of the exterior circuit, ie. closed circuit, open, different voltage, threshold voltage, etc..

exterior output module
. Same externally as the input, but on a command will send some kind of output to an exterior circuit, ie. simply lighting an LED.

serial / usb output
. with a little programming, (made far easier by drivers made by you guys ;) ) the bug can receive and transmit data via these means.

flash based hdd?



apologies if these have already been mentioned =]

g0pher
Mar 31, 2008 3:53pm
theRightNee 6 posts

Topic: BUGmodules / The Teleporter

i love the little humor throughout the project…youtube videos and such…but is there really no teleporter module??? i had thought perhaps it was a name for the phone module to come… :P getting my hopes up i guess

Mar 31, 2008 1:30pm
Medium agordon 74 posts

Topic: BUGbase / USB and Ethernet transfer rates

Hi, carlo.

I’ve done a few tests pushing data to a BUG over IP/USB between the BUG and a Mac, in which I got speeds averaging around 784KB/sec for small-ish files (10MB), but slower rates for larger files (100MB) in the neighborhood of 650KB/sec.

Mar 31, 2008 10:33am
carlo 1 post

Topic: BUGbase / USB and Ethernet transfer rates

I was wondering what peak rates could be achieved with USB and Ethernet with the BUG?

Say I wanted to develop an application to transfer a large file on the network via Ethernet and deposit the file to an external USB disk.

Thanks.

Mar 29, 2008 3:31pm
Medium agordon 74 posts

Topic: BUGbase / hardware question

Hi, araghuraman1.

If you’re looking to connect via UbiSync, the last time I checked, it was not supported under Linux. Even if it was, I think it also may require a little more RAM and CPU than a BUGbase provides.

I hate to give bad news, so I’ll do a little research on this and hopefully find something to contradict what I just said. Maybe it is possible.