Author Topic: Arduino anyone?  (Read 10184 times)

AJ Dual

  • friends
  • Senior Member
  • ***
  • Posts: 16,162
  • Shoe Ballistics Inc.
Re: Arduino anyone?
« Reply #25 on: November 16, 2010, 12:07:27 AM »
This is really cool, but who is going to make me my AFG?  :'(
I promise not to duck.

AZRedhawk44

  • friends
  • Senior Member
  • ***
  • Posts: 13,976
Re: Arduino anyone?
« Reply #26 on: November 16, 2010, 01:06:53 AM »
This is really cool, but who is going to make me my AFG?  :'(

That sounds vaguely like the type of Carnivore/Room641A/Echelon bait I tend to try to avoid.

I don't intend to manufacture any firearms for anyone.

However, it would be quite humorous to me if:
-Someone designed an "alternate" glock lower that could be printed on a RepRap in multiple pieces, none of which were classified as a "gun" according to current standards... or even multiple designs for those pieces so that there was no authoritative "set" of files to search for and ban.
-The ATF, in a fit of illogic beyond anything it ever conceived of prior, classified RepRaps as firearms, or owning a RepRap and having an internet connection to Thingiverse or other vault where open source 3D RepRap objects are housed, to be "constructive posession."
"But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist."
--Lysander Spooner

I reject your authoritah!

KD5NRH

  • friends
  • Senior Member
  • ***
  • Posts: 10,926
  • I'm too sexy for you people.
Re: Arduino anyone?
« Reply #27 on: November 16, 2010, 09:39:09 AM »
8.  Robot 2 - small solar panel recharger installed.  Digital altimeter circuit and GPS circuits installed.  Attain 100ft AGL, follow a programmed set of GPS coordinates, return home and recharge autonomously, then follow that route again and return home
9.  Robot 2 - Altitude test.  See how high it can go before it reaches a "point of no return" and have it return home safely with a log for maximum altitude on a full battery charge.  Wind may make this one tricky, and it may be a series of attempts, pushing my luck and tolerance for lost helicopter(s)
10.  Robot 2 - Pre-program a series of safe landing spots (roofs of grocery stores and such, probably) as GPS coordinates.  Send the helicopter on a multi-day expedition where it repeatedly lands and recharges itself.  Have it land, on float pontoons, in my parents' swimming pool in their backyard, 8 miles away

Intermediary projects may involve teasing the locals via LED light patterns at night and such. >:D

I'm also toying with a wireless ethernet shield for it, and having a fly-by-wire IP-based drone that responds to either immediate commands via joystick, or to batch-style command scripts that can be sent via "private" (as private as wireless can be, anyways) network.

Hmmm...non-continuous internet via warflyer?  WiFi repeater with airsnort running, flies around until it finds a network, cracks it, beams you a WiFi signal until the batteries get low, then returns home to recharge itself, going back to the good signal automatically as soon as the batteries are topped off?

RevDisk

  • friend
  • Senior Member
  • ***
  • Posts: 12,633
    • RevDisk.net
Re: Arduino anyone?
« Reply #28 on: November 16, 2010, 10:48:05 AM »
Hmmm...non-continuous internet via warflyer?  WiFi repeater with airsnort running, flies around until it finds a network, cracks it, beams you a WiFi signal until the batteries get low, then returns home to recharge itself, going back to the good signal automatically as soon as the batteries are topped off?

Nick and I were talking about designing exactly that. Sorta.  Design the system to be modular, so technically you could use it for any decentralized signal intelligence.  Be a very handy way for checking for speed traps (or other early warning) if you could triangulate police frequencies, no?

We drew up the architecture, but honestly, it would have been a lot of work and probably a multi-year project. 
"Rev, your picture is in my King James Bible, where Paul talks about "inventors of evil."  Yes, I know you'll take that as a compliment."  - Fistful, possibly highest compliment I've ever received.

KD5NRH

  • friends
  • Senior Member
  • ***
  • Posts: 10,926
  • I'm too sexy for you people.
Re: Arduino anyone?
« Reply #29 on: November 16, 2010, 11:43:35 AM »
Nick and I were talking about designing exactly that. Sorta.  Design the system to be modular, so technically you could use it for any decentralized signal intelligence.  Be a very handy way for checking for speed traps (or other early warning) if you could triangulate police frequencies, no?

A small helicopter with GPS and one of these would be great for gathering the data.  If it's uplinking the info in realtime, the processing power to triangulate multiple signals is easy on the ground.  Most non-trunked police systems are in the 150MHz range, which allows for small resonant antennas.  Trunking adds a lot of complexity, but the 800MHz and up frequencies allow for even smaller antennas and better directionality of the DF rig, meaning you can work with smaller angles between readings, and therefore, less movement of the detector.

Of course, some of the trunked systems have GPS in each unit and transmit their coordinates already, so it might be simpler to just crack that.

CNYCacher

  • friend
  • Senior Member
  • ***
  • Posts: 4,438
Re: Arduino anyone?
« Reply #30 on: November 19, 2010, 01:55:50 AM »
So, I received my Arduino Uno today in the mail.  I was giddy.  I think it might be broken. :(

Any time I load a sketch that produces any serial output, the serial connection breaks down to the point where if I go to the commandline and do "cat /dev/ttyACM0" (the serial device for the board) It will usually hang for 5-10 seconds before coming back with an I/O error.  Observe:

rich@home-base:~$ cat /dev/ttyACM0
cat: /dev/ttyACM0: Input/output error


Now, if I try ti 5 times, I  MIGHT get it to hookup once and be able to see the stuff the board is spewing across the serial line.

The IDE is not as tolerant.  As soon as it gets that I/O error, it gives up on that device and you need to restart the IDE.

On two occasions, I have been asked [by members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question.
Charles Babbage

AZRedhawk44

  • friends
  • Senior Member
  • ***
  • Posts: 13,976
Re: Arduino anyone?
« Reply #31 on: November 19, 2010, 09:40:20 AM »
Hmm.

What are you sending as serial output?

I don't have an "arduino" yet, but I did order a sanguino board for the RepRap I want to build along with some other small parts.  The Sanguino is just supposed to be a higher memory variant of the arduino and compatible with the IDE.

I just got it in the mail yesterday. I don't have plans to play with it until this weekend.

If you post your sketch code I can see if it performs the same error against my board.



ETA:  I'm not an arduino code guru... actually I think it's fair to say I'm not even a novice yet since I have yet to even use the IDE.  I intend to start here this weekend and see where I go with it:

http://www.ladyada.net/learn/arduino/index.html

But I'm willing to look at your sketch if you post it and see if it works against my hardware.
« Last Edit: November 19, 2010, 09:45:20 AM by AZRedhawk44 »
"But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist."
--Lysander Spooner

I reject your authoritah!

CNYCacher

  • friend
  • Senior Member
  • ***
  • Posts: 4,438
Re: Arduino anyone?
« Reply #32 on: November 19, 2010, 09:56:25 AM »
This was the first sketch that triggered it:
http://arduino.cc/en/Tutorial/DigitalReadSerial


It appears that I am not the only one with this issue:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286088093/0


The worst part is not being able to put a new sketch in.  it took me an hour or unplugging, replugging, restarting the IDE, various timing tricks, like press reset and quickly click upload, etc.  Just to get a new sketch installed (which stopped the problem).
On two occasions, I have been asked [by members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question.
Charles Babbage

AJ Dual

  • friends
  • Senior Member
  • ***
  • Posts: 16,162
  • Shoe Ballistics Inc.
Re: Arduino anyone?
« Reply #33 on: November 19, 2010, 09:58:23 AM »
That sounds vaguely like the type of Carnivore/Room641A/Echelon bait I tend to try to avoid.

I don't intend to manufacture any firearms for anyone.

However, it would be quite humorous to me if:
-Someone designed an "alternate" glock lower that could be printed on a RepRap in multiple pieces, none of which were classified as a "gun" according to current standards... or even multiple designs for those pieces so that there was no authoritative "set" of files to search for and ban.
-The ATF, in a fit of illogic beyond anything it ever conceived of prior, classified RepRaps as firearms, or owning a RepRap and having an internet connection to Thingiverse or other vault where open source 3D RepRap objects are housed, to be "constructive posession."

IMO, don't overthink it. Just leave big chunks of plastic and sprue on it so it's way less than 80% complete, but can be finished with simple tools.  :angel:

So now that's out of the way, how much do you want for AFG parts?  =D
I promise not to duck.

AZRedhawk44

  • friends
  • Senior Member
  • ***
  • Posts: 13,976
Re: Arduino anyone?
« Reply #34 on: November 23, 2010, 10:08:05 PM »
So I'm sitting here, messing with my first sketch.

I'm not on an Arduino, though... I'm running a Sanguino board.  this is a higher flash memory, higher RAM variant with more digital and analog outputs (as well as a second serial interface).  It's still programmable via the Arduino IDE, but you have to add an additional hardware folder to get it to work.

I bought this rather than a standard Arduino because:
-Family knows I really want an Arduino board for Christmas and I don't want to buy one before then;
-I really wanted to start learning before Christmas;
-I knew I'd need this board to build a RepRap because it was basically developed FOR RepRap since Arduinos were just a bit too limited in outputs and flash memory;
-I knew I could use this board to learn the Arduino IDE and language.

So, when I first turned on my Sanguino board, it turned on with green power LED on and the red debug LED flashing once a second. (These ship with two LED's soldered to the controller, and when ordered as a complete RepRap Motherboard they come with an SD card reader, an ATX power connector and several different ribbon cable connectors all over the perimeter of the board.) At first I thought something was wrong, but after researching it, Sanguinos are shipped that way.  It's a simple debug sketch to prove the thing works.  The red LED is evidently wired to digital pin 0.

So, I wrote my own sketch:

Code: [Select]
void setup() {
 //setup code
 
 //5 second delay in case of a wonked program... I can upload
 //a new sketch in that time.
 delay(5000);
 
 //start serial connection
 Serial.begin(9600);
 pinMode(0, OUTPUT);

}

void loop() {
 //main code
 
 
 //just making a loop to count from 1 to 100, then exit
 //and restart loop()
 
 int myint = 1;
 while (myint < 100) {
  Serial.println(myint, DEC);
  myint = myint + 1;
  delay(500);
  if (myint == 50) {
    digitalWrite(0, HIGH);
  }else{
    digitalWrite(0, LOW);
  }   
 }
 }
 

When I upload this sketch, I get EXACTLY the behavior I want.  I get a repeated loop on the serial monitor where it increments from 1 to 100, and the light flashes when it reaches 50 each time.

However, the green power led is not on in this  sketch.

I cannot find the debug sketch that was originally on it to re-enable the green power LED.  It isn't apparent what pin the green LED is connected to.

Is there a power and debug LED hardwired on your Arduino board?

Anyone able to find out how this green LED is interfaced to the rest of the system?  It was working an hour ago, and now doesn't.  It's not just direct-wired into the DC input voltage, or else it would still be on.  It must be controlled via one of the pin interfaces, but I can't for the life of me figure out which one.
"But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist."
--Lysander Spooner

I reject your authoritah!

AZRedhawk44

  • friends
  • Senior Member
  • ***
  • Posts: 13,976
Re: Arduino anyone?
« Reply #35 on: November 23, 2010, 11:21:54 PM »
OK, weird.

The green light turns on when I change the above to this:

Code: [Select]
void setup() {
 //setup code
 
 //5 second delay in case of a wonked program... I can upload
 //a new sketch in that time.
 delay(5000);
 
 //start serial connection
 Serial.begin(9600);
 pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
   pinMode(2, OUTPUT);
 pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
   pinMode(5, OUTPUT);
    pinMode(6, OUTPUT);
     pinMode(7, OUTPUT);
 pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
   pinMode(10, OUTPUT);
    pinMode(11, OUTPUT);
     pinMode(12, OUTPUT);
 pinMode(13, OUTPUT);
  pinMode(14, OUTPUT);
   pinMode(15, OUTPUT);
    pinMode(16, OUTPUT);
     
     
}

void loop() {
 //main code
 
 
 //just making a loop to count from 1 to 100, then exit
 //and restart loop()
 
 int myint = 1;
 while (myint < 100) {
  Serial.println(myint, DEC);
  myint = myint + 1;
  delay(500);
  if (myint < 17) {
    digitalWrite(myint, HIGH);
    delay(1000);
    digitalWrite(myint, LOW);
  }
  if (myint == 50) {
    digitalWrite(0, HIGH);
  }else{
    digitalWrite(0, LOW);
  }   
 }
 }
 

The green LED starts on when the board starts up, and it stays on after myint > 17.

I don't get it.

Heck, even if I change myint in the code to start at 51 (making the red light never turn on since the loop runs 51-99 perpetually), the green light is on now.
"But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist."
--Lysander Spooner

I reject your authoritah!

CNYCacher

  • friend
  • Senior Member
  • ***
  • Posts: 4,438
Re: Arduino anyone?
« Reply #36 on: November 24, 2010, 08:23:09 AM »
The first time you ran this sketch, did you not have the serial output running?  Just the counter from 1-99?
On two occasions, I have been asked [by members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question.
Charles Babbage

AZRedhawk44

  • friends
  • Senior Member
  • ***
  • Posts: 13,976
Re: Arduino anyone?
« Reply #37 on: November 24, 2010, 09:21:58 AM »
Serial output has been running every time I've run the sketch.

The green LED seems to have something to do with digital pin 14, I think.  I'm not on my Arduino computer right now, but I noticed a tendency for it to flash whenever I got to 14 in my loop code.  I started targeting only that pin and got it to respond.

But it's odd... no documentation anywhere that I can find that tells how to target that LED and that it's supposed to be attached to pin 14.  Even on the "build your own Sanguino" component oriented pages.
"But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist."
--Lysander Spooner

I reject your authoritah!

CNYCacher

  • friend
  • Senior Member
  • ***
  • Posts: 4,438
Re: Arduino anyone?
« Reply #38 on: November 24, 2010, 10:06:23 AM »
On my Uno, there is an LED attached to pin 13 for no reason other than debugging / testing.  Lots of the example scripts call for attaching an LED to pin13, then mention (your arduino may already have an led attached to this pin).
On two occasions, I have been asked [by members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question.
Charles Babbage

French G.

  • friend
  • Senior Member
  • ***
  • Posts: 10,195
  • ohhh sparkles!
Re: Arduino anyone?
« Reply #39 on: December 06, 2010, 10:07:12 PM »
http://www.ladyada.net/make/bedazzler/index.html

I must learn this electronic geekery.  >:D
AKA Navy Joe   

I'm so contrarian that I didn't respond to the thread.