Log in

View Full Version : PC geek required. Especially if you know what "arduino" means



Disco Dan
5th January 2013, 17:50
Hi all, hoping someone on hear may just so happen to work with Arduino boards and perhaps help me with a little programming in C++ (I think that's right).

Main problem I get is the program runs but it throws up "cannot find dependent libraries" errors for "Jmyron" (responsible for motion tracking a camera image).
Anyone able to shed any light please?! !

(Yes I know it's a bike forum and it's a bit of a blimin long shot, but I've come across KB'ers that work in the most obscure, bizarre and down right awesome places - my money is on at least ONE person on here will see the code below and go... "oooh I know what that means!" and hopefully be able to help!

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------





*/


// <================================================== =============================================>
// Begin custom values - change these servo positions and camera dimensions to work with your project
// <================================================== =============================================>

public int camWidth = 320; // camera width (pixels), usually 160*n
public int camHeight = 240; // camera height (pixels), usually 120*n

public float xMin = 142.0; // 0.0 used for calibration. adjust these numbers to work with
public float xMax = 47.0; // 180.0 your unique setup.
public float yMin = 140.0; // 180.0
public float yMax = 124.0; // 0.0

// <================================================== =============================================>
// End custom values
// <================================================== =============================================>


int[] diffPixelsColor = {
255, 255, 0
}; // Red, green, blue values (0-255) to show pixel as marked as target
public int effect = 0; // Effect

public boolean mirrorCam = false; // set true to mirror camera image

import JMyron.*;
import blobDetection.*;
import processing.serial.*;
import ddf.minim.*;
import java.awt.Frame;
import processing.opengl.*; // see note on OpenGL in void setup()
import procontroll.*;
import net.java.games.input.*;

public int minBlobArea = 30; // minimum target size (pixels)
public int tolerance = 100; // sensitivity to motion

public boolean runWithoutArduino = false;
public boolean connecting = false;


public Serial arduinoPort;
JMyron camInput;
BlobDetection target;
Blob blob;
Blob biggestBlob;


int[] Background;
int[] rawImage;
int[] rawBackground;
int[] currFrame;
int[] screenPixels;
public int targetX = camWidth/2;
public int targetY = camHeight/2;
int fire = 0;
int[] prevFire = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

float xRatio;
float yRatio;

int possibleX = camWidth/2;
int possibleY = camHeight/2;

int displayX = camWidth/2;
int displayY = camHeight/2;

int oldX = camWidth/2; // smoothing (contributed by Adam S.)
int oldY = camHeight/2; // smoothing
int xdiff; // smoothing
int ydiff; // smoothing
public float smoothingFactor = 0.8; // smoothing
public boolean activeSmoothing = true;

String strTargetx;
String strTargety;
String fireSelector;
String scanSelector;


public boolean showDifferentPixels = false;
public boolean showTargetBox = true;
public boolean showCameraView = true;
public boolean firingMode = true; // true = semi, false = auto
public boolean safety = true;
public boolean controlMode = true; // true = autonomous, false = manual
public boolean soundEffects = true; // set to true to enable sound effects by default
public boolean scanWhenIdle = true;
public boolean trackingMotion = true;

int idleTime = 10000; // how many milliseconds to wait until scanning (when in scan mode)
int idleBeginTime = 0;
boolean scan = false;

public String serPortUsed;

public int backgroundSet = 0;

int[][] fireRestrictedZones = new int[30][4];
int restrictedZone = 1;
boolean showRestrictedZones = false;

boolean selectingColor = false;
boolean trackingColor = false;
int trackColorTolerance = 100;
int trackColorRed = 255;
int trackColorGreen = 255;
int trackColorBlue = 255;

boolean selectingSafeColor = false;
boolean safeColor = false;
int safeColorMinSize = 500;
int safeColorTolerance = 100;
int safeColorRed = 0;
int safeColorGreen = 255;
int safeColorBlue = 0;


public boolean useInputDevice = false; // use a joystick or game controller as input (in manual mode)
public boolean inputDeviceIsSetup = false;

public ControllIO controlIO; // more stuff for using a joystick or game controller for input
public ControllDevice inputDevice;

public ControllButton[] buttons = new ControllButton[30];
public ControllSlider[] sliders = new ControllSlider[10];

public ControllButton[] fire_buttons = new ControllButton[0];
public ControllButton[] preciseAim_buttons = new ControllButton[0];
public ControllButton[] centerGun_buttons = new ControllButton[0];
public ControllButton[] autoOn_buttons = new ControllButton[0];
public ControllButton[] autoOff_buttons = new ControllButton[0];
public ControllButton[] inputToggle_buttons = new ControllButton[0];
public ControllButton[] randomSound_buttons = new ControllButton[0];

public ControllSlider[] pan_sliders = new ControllSlider[0];
public ControllSlider[] tilt_sliders = new ControllSlider[0];
public ControllSlider[] panInvert_sliders = new ControllSlider[0];
public ControllSlider[] tiltInvert_sliders = new ControllSlider[0];


public float xPosition = camWidth/2;
public float yPosition = camHeight/2;


String[] inStringSplit; // buffer for backup
int controlMode_i, safety_i, firingMode_i, scanWhenIdle_i, trackingMotion_i, trackingColor_i, leadTarget_i, safeColor_i,
showRestrictedZones_i, showDifferentPixels_i, showTargetBox_i, showCameraView_i, mirrorCam_i, soundEffects_i;


void setup() {
size(camWidth, camHeight); // some users have reported a faster framerate when the code utilizes OpenGL. To try this, comment out this line and uncomment the line below.
// size(camWidth, camHeight, OPENGL);
minim = new Minim(this);
loadSounds();
playSound(18);
camInput = new JMyron();
camInput.start(camWidth, camHeight);
camInput.findGlobs(0);
camInput.adaptivity(1.01);
camInput.update();
currFrame = camInput.image();
rawImage = camInput.image();
Background = camInput.image();
rawBackground = camInput.image();
screenPixels = camInput.image();
target = new BlobDetection(camWidth, camHeight);
target.setThreshold(0.9);
target.setPosDiscrimination(true);

retryArduinoConnect();

xRatio = (camWidth / (xMax - xMin)); // used to allign sights with crosshairs on PC
yRatio = (camHeight/ (yMax - yMin)); //
drawControlPanel();
}



void draw() {

EEPROMbackup();

if (controlMode) { // autonomous mode
autonomousMode(); //
}
else if (!controlMode) { // manual mode
manualMode(); //
}

if (fire == 1) {
idleBeginTime = millis();
scan = false;
}
else {
if (millis() > idleBeginTime + idleTime && controlMode && scanWhenIdle) {
scan = true;
}
else {
scan = false;
}
}

if (!safety) {
fire = 0;
}

strTargetx = "000" + str(targetX); // make into 3-digit numbers
strTargetx = strTargetx.substring(strTargetx.length()-3);
strTargety = "000" + str(targetY);
strTargety = strTargety.substring(strTargety.length()-3);
fireSelector = str(0);
if (firingMode) {
fireSelector = str(1);
}
else {
fireSelector = str(3);
}
if (scan) {
scanSelector = str(1);
}
else {
scanSelector = str(0);
}
//println('a' + strTargetx + strTargety + str(fire) + fireSelector + scanSelector);
if (!runWithoutArduino && !connecting) {
arduinoPort.write('a' + strTargetx + strTargety + str(fire) + fireSelector + scanSelector); // send to arduino
}

if ((keyPressed && key == 't') || showRestrictedZones) {
for (int col = 0; col <= restrictedZone; col++) {
noStroke();
fill(0, 255, 0, 100);
rect(fireRestrictedZones[col][0], fireRestrictedZones[col][2], fireRestrictedZones[col][1]-fireRestrictedZones[col][0], fireRestrictedZones[col][3]-fireRestrictedZones[col][2]);
}
}
if (selectingColor) {
stroke(190, 0, 190);
strokeWeight(2);
fill(red(currFrame[(mouseY*width)+mouseX]), green(currFrame[(mouseY*width)+mouseX]), blue(currFrame[(mouseY*width)+mouseX]));
rect(mouseX+2, mouseY+2, 30, 30);
}

if (selectingSafeColor) {
stroke(0, 255, 0);
strokeWeight(2);
fill(red(currFrame[(mouseY*width)+mouseX]), green(currFrame[(mouseY*width)+mouseX]), blue(currFrame[(mouseY*width)+mouseX]));
rect(mouseX+2, mouseY+2, 30, 30);
}

soundTimer++;
if (soundTimer == soundInterval) {
randomIdleSound();
soundTimer = 0;
}

for (int i = 9; i >= 1; i--) {
prevFire[i] = prevFire[i-1];
}
prevFire[0] = fire;
int sumNewFire = prevFire[0] + prevFire[1] + prevFire[2] + prevFire[3] + prevFire[4];
int sumPrevFire = prevFire[5] + prevFire[6] + prevFire[7] + prevFire[8] + prevFire[9];

if (sumNewFire == 0 && sumPrevFire == 5) { // target departed screen
int s = int(random(0, 6));
if (s == 0)
playSound(1);
if (s == 1)
playSound(5);
if (s == 2)
playSound(9);
if (s == 3)
playSound(12);
if (s == 4)
playSound(13);
if (s == 5)
playSound(20);
}

if (fire == 1)
strokeWeight(3);
if (fire == 0)
strokeWeight(1);
stroke(255, 0, 0); //draw crosshairs
noFill(); //
line(displayX, 0, displayX, camHeight); //
line(0, displayY, camWidth, displayY); //
ellipse(displayX, displayY, 20, 20); //
ellipse(displayX, displayY, 28, 22); //
ellipse(displayX, displayY, 36, 24); //

updateControlPanels();
prevTargetX = targetX;
prevTargetY = targetY;
}

void autonomousMode() {
if(inputDeviceIsSetup) {
checkInputDevice();
}

if (selectingColor || selectingSafeColor) {
cursor(1);
}
else {
cursor(0);
}
camInput.update();
rawBackground = camInput.retinaImage();
rawImage = camInput.image();
if (mirrorCam) {
for (int i = 0; i < camWidth*camHeight; i++) {
int y = floor(i/camWidth);
int x = i - (y*camWidth);
x = camWidth-x;
currFrame[i] = rawImage[(y*camWidth) + x-1];
Background[i] = rawBackground[(y*camWidth) + x-1];
}
}
else {
currFrame = rawImage;
Background = rawBackground;
}

loadPixels();
int safeColorPixelsCounter = 0;

for (int i = 0; i < camWidth*camHeight; i++) {
if (showCameraView) {
pixels[i] = currFrame[i];
}
else {
pixels[i] = color(0, 0, 0);
}

boolean motion = (((abs(red(currFrame[i])-red(Background[i])) + abs(green(currFrame[i])-green(Background[i])) + abs(blue(currFrame[i])-blue(Background[i]))) > (200-tolerance)) && trackingMotion);
boolean isTrackedColor = (((abs(red(currFrame[i])-trackColorRed) + abs(green(currFrame[i])-trackColorGreen) + abs(blue(currFrame[i])-trackColorBlue)) < trackColorTolerance) && trackingColor);

boolean isSafeColor = (((abs(red(currFrame[i])-safeColorRed) + abs(green(currFrame[i])-safeColorGreen) + abs(blue(currFrame[i])-safeColorBlue)) < safeColorTolerance) && safeColor);

if (motion || isTrackedColor) {
screenPixels[i] = color(255, 255, 255);
if (showDifferentPixels) {
if (effect == 0) {
pixels[i] = color(diffPixelsColor[0], diffPixelsColor[1], diffPixelsColor[2]);
}
else if (effect == 1) {
pixels[i] = color((diffPixelsColor[0] + red(currFrame[i]))/2, (diffPixelsColor[1] + green(currFrame[i]))/2, (diffPixelsColor[2] + blue(currFrame[i]))/2);
}
else if (effect == 2) {
pixels[i] = color(255-red(currFrame[i]), 255-green(currFrame[i]), 255-blue(currFrame[i]));
}
else if (effect == 3) {
pixels[i] = color((diffPixelsColor[0] + (255-red(currFrame[i])))/2, (diffPixelsColor[1] + (255-green(currFrame[i])))/2, (diffPixelsColor[2] + (255-blue(currFrame[i])))/2);
}
}
}
else {
screenPixels[i] = color(0, 0, 0);
}

if (isSafeColor) {
safeColorPixelsCounter++;
pixels[i] = color(0, 255, 0);
screenPixels[i] = color(0, 0, 0);
}
}



updatePixels();

int biggestBlobArea = 0;
target.computeBlobs(screenPixels);
for (int i = 0; i < target.getBlobNb()-1; i++) {
blob = target.getBlob(i);
int blobWidth = int(blob.w*camWidth);
int blobHeight = int(blob.h*camHeight);
if (blobWidth*blobHeight >= biggestBlobArea) {
biggestBlob = target.getBlob(i);
biggestBlobArea = int(biggestBlob.w*camWidth)*int(biggestBlob.h*camH eight);
}
}
possibleX = 0;
possibleY = 0;

if (biggestBlobArea >= minBlobArea) {
possibleX = int(biggestBlob.x * camWidth);
possibleY = int(biggestBlob.y * camHeight);
}


if ((biggestBlobArea >= minBlobArea)) {
fire = 1;
if (showTargetBox) {
stroke(255, 50, 50);
strokeWeight(3);
fill(255, 50, 50, 150);
rect(int(biggestBlob.xMin*camWidth), int(biggestBlob.yMin*camHeight), int((biggestBlob.xMax-biggestBlob.xMin)*camWidth), int((biggestBlob.yMax-biggestBlob.yMin)*camHeight));
}

anticipation();

if (activeSmoothing) {
xdiff = possibleX - oldX; // smoothing
ydiff = possibleY - oldY; // smoothing
possibleX = int(oldX + xdiff*(1.0-smoothingFactor)); // smoothing
possibleY = int(oldY + ydiff*(1.0-smoothingFactor)); // smoothing
}

displayX = possibleX;
displayY = possibleY;
if (displayX < 0)
displayX = 0;
if (displayX > camWidth)
displayX = camWidth;
if (displayY < 0)
displayY = 0;
if (displayY > camHeight)
displayY = 0;
targetX = int((possibleX/xRatio)+xMin);
targetY = int(((camHeight-possibleY)/yRatio)+yMin);
oldX = possibleX; // smoothing
oldY = possibleY; // smoothing
}
else {
fire = 0;
}

boolean clearOfZones = true;
for (int col = 0; col <= restrictedZone; col++) {
if (possibleX > fireRestrictedZones[col][0] && possibleX < fireRestrictedZones[col][1] && possibleY > fireRestrictedZones[col][2] && possibleY < fireRestrictedZones[col][3]) {
clearOfZones = false;
fire = 0;
}
}


if (safeColorPixelsCounter > safeColorMinSize && safeColor) {
noStroke();
fill(0, 255, 0, 150);
rect(0, 0, width, height);
fire = 0;
targetX = int((xMin+xMax)/2.0);
targetY = int(yMin);
displayX = camWidth/2;
displayY = camHeight;
}
}

void manualMode() {
cursor(1);
camInput.update();
rawBackground = camInput.retinaImage();
rawImage = camInput.image();
if (mirrorCam) {
for (int i = 0; i < camWidth*camHeight; i++) {
int y = floor(i/camWidth);
int x = i - (y*camWidth);
x = camWidth-x;
currFrame[i] = rawImage[(y*camWidth) + x-1];
Background[i] = rawBackground[(y*camWidth) + x-1];
}
}
else {
currFrame = rawImage;
Background = rawBackground;
}

loadPixels(); //draw camera view to screen
for (int i = 0; i < camWidth*camHeight; i++) { //
pixels[i] = currFrame[i]; //
} //
updatePixels(); //

if(inputDeviceIsSetup) {
checkInputDevice();
}
if(useInputDevice) {
updateInputDevice(); // determine control values using the input device (see declaration in Input_Device tab)
}else{
targetX = int((mouseX/xRatio)+xMin); // calculate position to go to based on mouse position
targetY = int(((camHeight-mouseY)/yRatio)+yMin); //
displayX = mouseX;
displayY = mouseY;
if (mousePressed) {
fire = 1;
}
else {
fire = 0;
}
}
}


void mousePressed() {
if (keyPressed && key == 'r') {
print("constraints:" + mouseX + ", " + mouseY);
fireRestrictedZones[restrictedZone][0] = mouseX;
fireRestrictedZones[restrictedZone][2] = mouseY;
}
if (selectingColor) {
trackColorRed = int(red(currFrame[(mouseY*width)+mouseX]));
trackColorBlue = int(blue(currFrame[(mouseY*width)+mouseX]));
trackColorGreen = int(green(currFrame[(mouseY*width)+mouseX]));
selectingColor = false;
}

if (selectingSafeColor) {
safeColorRed = int(red(currFrame[(mouseY*width)+mouseX]));
safeColorBlue = int(blue(currFrame[(mouseY*width)+mouseX]));
safeColorGreen = int(green(currFrame[(mouseY*width)+mouseX]));
selectingSafeColor = false;
}
}

void mouseReleased() {
if (keyPressed && key == 'r') {
println(" ... " + mouseX + ", " + mouseY);
fireRestrictedZones[restrictedZone][1] = mouseX;
fireRestrictedZones[restrictedZone][3] = mouseY;
if (fireRestrictedZones[restrictedZone][1]>fireRestrictedZones[restrictedZone][0] && fireRestrictedZones[restrictedZone][1]>fireRestrictedZones[restrictedZone][2]) {
restrictedZone++;
}
}
}

void keyReleased() {
if ( key == 'p') {
randomIdleSound();
}

if (key == ' ') {
controlMode = !controlMode;
}

if (key == 'b') {
camInput.adapt();
playSound(15);
}
if (key == 'a') {
xMin = float(targetX);
xRatio = (camWidth / (xMax - xMin)); // used to allign sights with crosshairs on PC
}
if (key == 'd') {
xMax = float(targetX);
xRatio = (camWidth / (xMax - xMin)); // used to allign sights with crosshairs on PC
}
if (key == 's') {
yMin = float(targetY);
yRatio = (camHeight/ (yMax - yMin)); //
}
if (key == 'w') {
yMax = float(targetY);
yRatio = (camHeight/ (yMax - yMin)); //
}
}



public void viewCameraSettings() {
camInput.settings();
playSound(21);
}

public void openWebsite() {
link("https://sites.google.com/site/projectsentrygun/");
playSound(15);
}

public void setBackground() {
camInput.adapt();
playSound(11);
}

public void playRandomSound() {
randomIdleSound();
}

public void selectColor() {
selectingColor = true;
}

public void selectSafeColor() {
selectingSafeColor = true;
}

public void radioEffect(int ID) {
effect = ID + 1;
}


public void stop() {
s1.rewind();
s1.play();
delay(2500);
s1.close();
s2.close();
s3.close();
s4.close();
s5.close();
s7.close();
s6.close();
s8.close();
s9.close();
s10.close();
s11.close();
s12.close();
s13.close();
s14.close();
s15.close();
s16.close();
s17.close();
s18.close();
s19.close();
s20.close();
s21.close();
minim.stop();
if (!runWithoutArduino) {
arduinoPort.write("z0000000");
delay(500);
arduinoPort.stop();
}
camInput.stop();
super.stop();
}

Oakie
5th January 2013, 18:17
May I refer you to the 'PressF1' forum. http://pressf1.pcworld.co.nz/forum.php You think we have shitfights here on KB? Just spend an evening or two on PressF1 and we will seem like a tame bunch of kindy kids.

imdying
5th January 2013, 18:52
It's the line import Jmyron.* doing it. See the other imports, make sure the Jmyron library is stored in the same place as those, it's probably a folder in the Arduino IDE's folder. I've stopped using that and now use the Arduino plugin for Visual Studio. Much much faster and easier, plus you get all the nice VS IDE features.

bogan
5th January 2013, 19:09
It's the line import Jmyron.* doing it. See the other imports, make sure the Jmyron library is stored in the same place as those, it's probably a folder in the Arduino IDE's folder. I've stopped using that and now use the Arduino plugin for Visual Studio. Much much faster and easier, plus you get all the nice VS IDE features.

+1, would be my guess too. If you don't want to move the file (winsearch to find it), just add its path to system, or include the path as an additional project library. Is that plugin for the micros behind arduino as well? I avoid of arduino stuff as it just as easy to do custom board design, and a lot cheaper!

Disco Dan
5th January 2013, 19:12
It's the line import Jmyron.* doing it. See the other imports, make sure the Jmyron library is stored in the same place as those, it's probably a folder in the Arduino IDE's folder. I've stopped using that and now use the Arduino plugin for Visual Studio. Much much faster and easier, plus you get all the nice VS IDE features.

Terrific cheers, will take a look

bogan
5th January 2013, 19:18
Also, I've found OpenCV and its GPU libraries very handy for image processing, if that might be useful for you? Spent about 3 days just getting it all installed, similar massive headaches with library files... So if you want some installation tips, I've found a few!

Disco Dan
5th January 2013, 19:29
Also, I've found OpenCV and its GPU libraries very handy for image processing, if that might be useful for you? Spent about 3 days just getting it all installed, similar massive headaches with library files... So if you want some installation tips, I've found a few!

I should add my total programming experience before I started consisted of "drawing a flag using RMBasic on a Spectrum Sinclair ZX when I was about 12" - this is one heck of a learning curve already!

If I can get the libraries to play ball the rest 'should' just work.

Anything after that should be just around me tweaking the settings and perhaps adding GPS, WiFi capabilities etc which I should be able to handle with time.

YellowDog
5th January 2013, 19:36
Nice one Disco Dan and it looks like you have a great result.

Though sticking pins in yourself might be less painful :crazy:

Good luck :yes:

bogan
5th January 2013, 19:54
If I can get the libraries to play ball the rest 'should' just work.

:killingme We'll check back in a week shall we?

Seriously though, good luck, but don't be surprised if there are days where you are just chasing down little errors. Implicit casting not working as you expect, pointer and addressing errors.... etc. I've just got back into C++ after years of C# and a decent amount of embedded device programming with C/C++, and still a lot to learn, and more than a few trip up on the 'simple' stuff. So don't get disheartened if it takes a lot longer than expected, if you can locate the error to within 10 lines of code me or someone else here should be able to offer advice.

Disco Dan
5th January 2013, 20:05
I avoid of arduino stuff as it just as easy to do custom board design, and a lot cheaper!

I remember etching my own PCB's in school - was great fun.

At this stage I have the Arduino board and this mass of wires, resisters, LED's etc going all over the place on a big breadboard. Once I enter the development stage of my project I will be looking at ditching the breadboard and creating a custom shield.

...ps no-one has asked what it does yet ;)

Disco Dan
5th January 2013, 20:05
:killingme We'll check back in a week shall we?

*ahem* yes most likely!

bogan
5th January 2013, 20:38
...ps no-one has asked what it does yet ;)

We must be a superstitious bunch then, we'll ask once you have got it sussed out ;)

Akzle
5th January 2013, 21:37
you're right. and there's much better arduino spaces online for advice.
i'm no arduino fan, nor C++ fan.

missing dependent libraries, obviously points, to missing dependent libraries. check you have jmyron and ALL DEPENDENCIES available.

also, i thought arduino was a proprietary language, so if you're compiling from c++ to arduino you may be mucking up some links.

also, look for a debugger to run your script through, fucked if i'm reading it.

Zerker
5th January 2013, 22:02
as stated most likely the file JMyron is not located in the source directory, or you have not linked the dependencies in your IDE to show the pre-processor where to grab those as well, so it finds JMyron and allows code to compile then once running and trying to make a call to a JMyron dependency it fails to make call as the class is not there.

are you sure this is not Java instead of C++? it's been a while since I looked at code that wasn't some form of scripting language, but hey here is some advice you want it.

the intended use of an "IF" statement is in the form of if then else. if you have a situation that calls for if then or if then or if then, the more appropriate statement to use is a Switch statement, it's more efficient and easier to read, hope this helps.

an error handler is a piece of code that wraps around your function calls to catch errors, that way if a function call comes back with an unexpected result like a 'null' value it doesn't just end the application and throw up an un-handled exception error, it can log the error or display a message to help you work out at what point the error occurred, it can also let the application continue if possible, google it and debugging will get easier, or you can just comment in a print line statement each time you attempt something, if your getting an error and think it's associated with a certain area of code un comment the print lines and you will see in the console records of what was last attempted before crash occurred.



oh yeah, and what does it do? my first guess was an atuo aim/kill bot for games that uses a webcam instead of reading memory space or .dll injection, then I thought it might be for an automated drone that tracks and follows objects, then I thought it was for motion activated camera that follows objects that come into view and takes stills. and now I'm not sure.

Zerker

bogan
5th January 2013, 22:08
i thought arduino was a proprietary language

Definitely not. Arduinos are just Atmegas in a general purpose breakout PCB, they have a dumbed down SDK which is probably what you're thinking of (which Disco is obviously not using), but I'm pretty sure it is just a library of basic C++ functions wrapped up in an easy to use interface.

Disco Dan
6th January 2013, 19:50
Well I got it sorted, apparently the two IDE programs had created their own temp folders in rather bizarre locations. Once I was able to point the programs to my own folders the problem was fixed.




oh yeah, and what does it do? my first guess was an atuo aim/kill bot for games that uses a webcam instead of reading memory space or .dll injection, then I thought it might be for an automated drone that tracks and follows objects, then I thought it was for motion activated camera that follows objects that come into view and takes stills. and now I'm not sure.

Zerker

Your warm but once first prototype is complete I may post a video ;)

Let's just say for testing my first prototype I need someone to run about with a (small) shield in front of it and to try to stay alive. I'm waiting for a text back from Skidmark.





Definitely not. Arduinos are just Atmegas in a general purpose breakout PCB, they have a dumbed down SDK which is probably what you're thinking of (which Disco is obviously not using), but I'm pretty sure it is just a library of basic C++ functions wrapped up in an easy to use interface.

There is a program that comes with it, plug the board in USB and the program converts the code and flashes the board. You can then disconnect the board and run your program without a PC.

It is primarily used by students for study as it is good for prototyping. Some boards are even used in retail items - since the boards and software is open source your allowed to write a program to the board, create the hardware (robot arm, home automation etc) and sell it as your own work.

Disco Dan
6th January 2013, 20:04
I figured I would post a video of what someone else did... I'm basically building my own, it's better and I just tested it using a tennis ball - Threw tennis ball across it's field of view and it hit the ball about once every second the whole time it was flying through the air.

Now... do I give Skidmark a shield and tell him or just tell him to "meet me in a paddock somewhere" :2thumbsup

<iframe width="420" height="315" src="http://www.youtube.com/embed/n_wtt_wueP0" frameborder="0" allowfullscreen></iframe>

<iframe width="560" height="315" src="http://www.youtube.com/embed/HQDy-5IQvuU" frameborder="0" allowfullscreen></iframe>

And this one is what you can do with enough money:

<iframe width="420" height="315" src="http://www.youtube.com/embed/v5YftEAbmMQ" frameborder="0" allowfullscreen></iframe>

bogan
6th January 2013, 20:33
There is a program that comes with it, plug the board in USB and the program converts the code and flashes the board. You can then disconnect the board and run your program without a PC.

It is primarily used by students for study as it is good for prototyping. Some boards are even used in retail items - since the boards and software is open source your allowed to write a program to the board, create the hardware (robot arm, home automation etc) and sell it as your own work.

Bootloader by the sounds of it.

Yeh its funny how many projects go from prototype to production without a production redesign. Saving a bit of time in development tends to cost a lot more later. For example, ISP programmer (USB to SPI for 6 pin chip programming) is about 20 bucks, ATTiny through ATmegs is like 2-12 bucks depending on the flavour. 2 Layer proto boards are getting pretty cheap, like 10 setup fee plus 2.50 per sq in. And with custom pcb you won't need any breadboard breakouts etc, and can use cheaper SMT stuff. I reckon with good planning for the lead times for pcbs/components, its better in pretty much all situations if you have the skills to do it.

Disco Dan
7th January 2013, 13:47
Got it all working, here is initial testing/demo:

<iframe width="560" height="315" src="http://www.youtube.com/embed/Qe9ccpQBnR8" frameborder="0" allowfullscreen></iframe>

Disco Dan
7th January 2013, 13:55
Bootloader by the sounds of it.

Yeh its funny how many projects go from prototype to production without a production redesign. Saving a bit of time in development tends to cost a lot more later. For example, ISP programmer (USB to SPI for 6 pin chip programming) is about 20 bucks, ATTiny through ATmegs is like 2-12 bucks depending on the flavour. 2 Layer proto boards are getting pretty cheap, like 10 setup fee plus 2.50 per sq in. And with custom pcb you won't need any breadboard breakouts etc, and can use cheaper SMT stuff. I reckon with good planning for the lead times for pcbs/components, its better in pretty much all situations if you have the skills to do it.

Just about eliminated the need for extra PCB/breadboards now. See above video - the only thing the breadboard is doing is supplying power to the three servos.

I just need to solder them together to form to bunches (+ and -) and then terminate them at a plug pack socket installed in the case. That way I just plug it in and it works.

Dave-
21st January 2013, 21:34
that is a sweet project!

mattman141
7th February 2013, 23:42
Looking good. :yes:

Wonder if I could do a similar thing with my MSP430.

Akzle
8th February 2013, 08:48
it sounds like glados