It seems Bug Labs might be the next gen Arduino platform.
What or Who is Bug Labs ?
Bug Labs is a new technology company that wants to encourage new wannabe engineers. It is a easy start up platform since it does not require any soldering and you do not have to learn anything about solid state electronics.
Products
Bug Base
The BUGbase ‘Hiro P’ Edition is the “anchor” of the BUG ecosystem. Each BUGbase is a fully programmable computer, with a CPU, RAM, rechargeable lithium-ion battery, USB, Ethernet, MMC and serial interfaces, and a small LCD with button controls. BUGbase also has 4 slots in which any combination of BUGmodules may be inserted.
BUGview is a 2.46” 320×240 LCD screen which can be used as a touch-sensitive interface. This useful BUGmodule can be used both as a display and as an input device.
BUGmotion is a module with two components: a motion detector and an accelerometer. The motion detector has a range of up to 2m, and detects as little as 30cm of motion. The accelerometer has scalable sensitivity between 2.5g and 10g.
BUGlocate provides GPS receiver capabilities to the BUGbase. It has a passive internal antenna and includes a connector for an external active antenna. BUGlocate uses an SiRF chipset based implementation.
BUGcam2MP is a 2 megapixel digital camera module with a built-in flash.
Code
A lot of the coding is done in Java which is good news for a lot of people out there so you do not have to learn a whole new language or a language that has been slightly adjusted with some differences here and there.
Example
Here is some example code from a GPS Logger that was made. This piece of code is used to match the long and latitude to match a Google map tile.
package gpslogger;
import java.awt.Point;
/**
* GoogleTile.java - describes a Google Tile object that represents a 256x256 pixel
* chunk of the earth's surface.
*
* @author Sean Hill
* @author Dave Sant
*/
public class GoogleTile {
// The point (x,y) for this tile
private Point p;
// The coord (lat,lon) that was used to create this tile
private Point2D co;
// Zoom level for this tile
private int z;
// ...Constants...
private double PI = 3.1415926535;
private int tileSize = 256;
private float pixelsPerLonDegree[] = new float[18];
private float pixelsPerLonRadian[] = new float[18];
private int numTiles[] = new int[18];
private Point2D bitmapOrigo[] = new Point2D.Double[18];
// Note: These variable names are based on the variables names found in the
// Google maps.*.js code.
private int c = 256;
private double bc;
private double Wa;
// Fill in the constants array
private void fillInConstants() {
this.bc = 2*this.PI;
this.Wa = this.PI/180;
for(int d = 17; d >= 0; --d) {
float f1 = (this.c / 360f);
this.pixelsPerLonDegree[d] = f1;
this.pixelsPerLonRadian[d]=(float) (this.c / this.bc);
int e = this.c / 2;
this.bitmapOrigo[d] = new Point2D.Double(e,e);
this.numTiles[d] = (this.c / 256);
this.c *= 2;
}
}
public GoogleTile(double latitude, double longitude, int zoomLevel) {
this.fillInConstants();
this.z = zoomLevel;
this.p = this.getTileCoordinate(latitude, longitude, zoomLevel);
this.co = new Point2D.Double(latitude, longitude);
}
public Point getTileCoord() {
return this.p;
}
public Point2D getTileLatLong() {
return this.co;
}
private Point2D getBitmapCoordinate(double a, double b, int c) {
Point2D d = new Point2D.Double(0,0);
double thispplon = this.pixelsPerLonDegree[c];
Point2D sp = this.bitmapOrigo[c];
int newX = (int) Math.floor(sp.getX() + (b * thispplon));
double e = Math.sin(a * this.Wa);
if(e > 0.9999) {
e = 0.9999;
}
if(e < -0.9999) {
e = -0.9999;
}
double thispplonrad = this.pixelsPerLonRadian[c];
int newY = (int) Math.floor(sp.getY() + 0.5 * Math.log((1 + e) / (1 - e)) * -1*(thispplonrad));
d.setLocation(newX, newY);
return d;
}
private Point getTileCoordinate(double a, double b, int c) {
Point2D d = this.getBitmapCoordinate(a, b, c);
Point e = new Point((int)(Math.floor(d.getX() / this.tileSize)),(int)(Math.floor(d.getY() / this.tileSize)));
return e;
}
public int getZoom() {
return this.z;
}
}
Code Source
As with the Arduino Bug Labs also has an entire community available and a good system where user programs our posted with the option to download earlier versions. Everything is open source and all the codes are very well commented.
Reflection
There are some really interesting projects here and the modules look great to play with as well. Although the pricing of the units is a lot higher then what you would spend on the Arduino. Even so it seems well worth it, to bad its our last year here otherwise we might have been able to persuade TVU to give this a go for next year.
Bug Labs
No comments:
Post a Comment