Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: To debug or not debug... That, is the question! on: April 13, 2011, 03:22:48 pm
See reply #3.


Please correct me if I'm wrong. But isn't reply #3 just a preprocessor version of what I originally said?

If so, I was worried what effect (if any) 120+ Serial.print messages constantly running into nowhere would have. It's a definite "no problem"?

Thanks for your attention to my questions  : )

2  Using Arduino / Programming Questions / Re: To debug or not debug... That, is the question! on: April 13, 2011, 02:46:01 pm

#ifdef DEBUG
   Serial.print();
#endif

However this get real messy real fast and can make the code all but impossible to read if there are a lot of them.




That's really the issue for me. I currently have over 120 serial.print lines for debugging and would like to put a lot more.

Putting 120 plus #ifdef DEBUG / #endif all over the place is something I would like to avoid  smiley-cry

Does anyone know for sure if it is safe to just toggle the Serial.begin() on and off to stop the Arduino sending messages?


Thanks  : )





3  Using Arduino / Programming Questions / To debug or not debug... That, is the question! on: April 11, 2011, 12:04:51 pm


Since debugging in Arduino seems all about printing values through the serial port, I was wondering the best way to turn on and off debugging.

Every time I want to check an area of code do I have to put in on/off states? Example:

int debug = 1;

if (debug == 1) {
Serial.println("If you're reading this message... RUN!!!!!!!!!");
}


That means putting "if (debug == 1) {" conditions everywhere I put Serial.print. Adding a lot of lines of code  : (


Or:

Can I just condition a single line of code to toggle everything? Example:


if (debug == 1) {
  Serial.begin(9600);
  }
 Which basically stops the Arduino from communicating.

I'm wondering if removing the Serial.begin function is ok if there is still Serial.print code all over the rest of the program?

Will it cause any problems?


Thanks for any help!


4  Topics / Education and Teaching / Re: Is there a good software program to learn electronics? on: April 06, 2011, 12:55:11 pm

Wow!

Look at this free circuit simulation java app:

http://www.falstad.com/circuit/


Also:

http://www.falstad.com/mathphysics.html


http://icircuitapp.com/




5  Topics / Education and Teaching / Re: Is there a good software program to learn electronics? on: April 06, 2011, 08:36:26 am

Check youtube for vids on iCircuit.

I don't have an iPad but would like to have something like this for Windows.

6  Using Arduino / Motors, Mechanics, and Power / Re: Many actuators, one motor controller, one power supply: possible? on: April 05, 2011, 08:35:57 am

Anyone know if I can put the Arduino 5v and GND on bus bars. Then attach all 5V and Gnds to the actuators. Then take the signal wires to the Arduino analog pins?

Is that spreading too thin?

Should I use another 5 relays for the potentiometers?



Close...but not quite what I had in mind. I though that the OutA output of the driver would be common to all actuators. The OutB would be the one that is switched by the relays.

It should be doable with only 5 relays then.

OK, wasn't sure if it would be a problem because sometimes OutA will be positive, sometimes negative.

Thanks!
7  Community / Website and Forum / Re: Moderation Guidelines && Applications for Moderators on: April 04, 2011, 04:17:44 pm
Guys,

we will be having a meeting about how to distribute responsibilities. I am busy to handle this until next Monday, therefore I have to ask you for a little patience. The university is keeping me busy this week.

On the other hand, even if we put a deadline, the application to become moderator is an open one, our forum is really big, we need a lot of help to handle things in here.


We know you are too busy.

Let us help you already!

Stop hogging all the problems. Share the wealth!

 smiley-razz

8  Using Arduino / Motors, Mechanics, and Power / Re: Many actuators, one motor controller, one power supply: possible? on: April 04, 2011, 03:17:25 pm
I've attached a quick schematic.

I'm sorry it's very ugly  smiley-red

Would this work correctly?

Each actuator would have 2 relays. So 5 actuators, 10 relays.

I don't have time right now to do the potentiometer connections. But could I put the Arduino 5v and GND on bus bars. Attach all 5V and Gnds to the actuators. And then take the signal wires to the Arduino analog pins?
9  Using Arduino / Motors, Mechanics, and Power / Many actuators, one motor controller, one power supply: possible? on: April 03, 2011, 12:48:37 pm


I would like to control 5 or more linear actuators (with potentiometers) using a single motor driver and power supply. (to keep costs low)

I'm thinking:

Power supply
Around 12v 6 amp

Motor controller
Pololu High-Power Motor Driver 18v15
http://www.pololu.com/catalog/product/755/

Actuators
http://www.servocity.com/html/25_lbs__thrust_linear_actuator.html
Operating Voltage: 6.0-12 Volts DC
Current Drain (12V): 800mah operating No load
Current Drain (12V): 3200mah operating Max load
Potentiometer: I0K

I only need to move one actuator at a time. Just direction and position. Speed control not needed.

Is it possible to connect all actuators to some kind of "switch box" that the Arduino could control and monitor?

The idea being:

actuator #1
change direction, watch potentiometer, stop on specified value

switch to actuator #2
change direction, watch potentiometer, stop on specified value

Then the next one and next one.


Thanks for any help  : )
10  Using Arduino / General Electronics / Best Normally Closed switch for Arduino control? on: March 31, 2011, 12:13:54 pm

I would like to control a 12V 250mA light using the Arduino.

But I want the light to remain lit if the Arduino is off or in the middle of a reset.

So I need a controllable switch that is normally closed.


Thanks for any help!
11  Using Arduino / General Electronics / Re: Random i2c errors, need help to stomp them out please! on: March 19, 2011, 04:49:50 pm
It looks like the watchdog timer only has a range of 1-8 seconds?

Is there a way to get more time? I would prefer 3-4 minutes.

I need big lengths of time in my code for motor movements for example. There are many long delays in my code longer than 8 seconds. Plus many little ones that add up.

Would prefer not to bust up my code into little 8 second chunks if possible.


I put in one decoupling capacitor and the 1.5k resistors. It did seem to help, but still get freezing. Just after longer periods smiley-confuse

I put in the decoupling capacitor before the RTC but after the pull up resistors. Can I put another capacitor before the pull up resistors? That would seem to give a clean signal to the i2c clock and data lines maybe?

Can I put as many capacitors as I like all over? Or are there problems in doing so?

To ask again, would putting decoupling capacitors on clock and gnd and data and gnd between each light do anything? Or would that destroy the signal instead of stabilize it?

And again, does anyone know where to buy an i2c extender breakout board?

Thanks  : )
12  Using Arduino / Sensors / Using a devices LED AS a trigger. Suggestions please. on: March 19, 2011, 03:00:31 pm

If I wanted to use another devices LED as a trigger for the Arduino, what would be the options?

I know I can use a photo resistor to point at an LED and use its input on the Arduino as a trigger. But is there another way?

Can I clip on to the LED power and ground leads and get a reading from that on the Arduino? Or must the Arduino be in the circuit for that to work?

Thanks for any help.
13  Using Arduino / General Electronics / Re: Random i2c errors, need help to stomp them out please! on: March 17, 2011, 01:13:35 pm

Those last 2 posts really gave me a lot to look into  smiley-eek-blue


Quote
Perhaps it's time to incorporate an I2C extender into your design.  http://ics.nxp.com/products/i2chubs/#Introduction .  I'm guessing that if put a scope on the signals they will look like crap!

I would agree. I think the issue is a bad signal.

There was an excellent document on that site:

http://ics.nxp.com/literature/presentations/interface/pdf/debug.i2c.oscilloscope.pdf

People interested in i2c should give it a look.

A wild guess at my freezing problem would be this quote:

Quote
The SDA line is stuck low because the slave is stuck in the transmitter mode

So an I2C extender really seems like it would solve my problem. But I couldn't find a product I can just start using : (

Can you recommend a product? An I2C extender breakout board for example?



Quote
So the first question is, are you fiddling with interrupts? Like disabling them from time to time?

Nope.


Quote
What you could consider is a "watchdog timer".

Researching a bit shows that to be very tricky. Maybe too tricky for me. Unless there is an easy way to do it without a risk of locking up your Arduino or having to create custom bootloaders.


Quote
Did you try the suggestion of lower pull-up resistors?

I did. I didn't have 1.5k as suggested, but I did try 2.2k and noticed no difference in stability. I will try 1.5k when I get my hands on them.


I'm considering replacing the ribbon cable with a cat 5 between the lights in case that helps keep noise out. Are there any off the shelf adapters with a cat 5 female on one side and a 0.1" 4 or more input female on the other? Or would making 15 patch points add just as much instability?

Also, would putting decoupling capacitors on clock and gnd and data and gnd between each light do anything? Or would that destroy the signal instead of stabilize it?

Thanks for all your help!
14  Using Arduino / General Electronics / Re: Random i2c errors, need help to stomp them out please! on: March 15, 2011, 12:00:34 pm
Quote
How do you know the problem is in the I2C endTransmission, and not somewhere else?

I put a lot of Serial.print() lines in my code. Everything works before the Wire.endTransmission() line, but it never comes out of the Wire.endTransmission() line when there is a freeze. The Arduino is just stuck there.



Quote
I'm curious. What is your project?
I take it that your switching speeds on the i2c cable are not very fast. Is that true?

It's an artistic clock. I'm not sure what you mean by switching speeds. If you mean how often am I sending i2c communications, then it varies. But it is not a non stop stream of commands. I tried to put as many delays in between communications as possible. I could put more in. But for example it has frozen after a 30 second delay. I put the big delay in just to make sure everything was quiet when the transmission was sent   smiley-cry
15  Community / Website and Forum / Re: Moderation Guidelines && Applications for Moderators on: March 15, 2011, 12:47:25 am
I would like to help.

Interactive Art
Product Design
Exhibition / Gallery
Suggestions for the Arduino Project
Other Hardware Development
General Category :: General Discussion

And I could be an extra pair of mod eyes in:
Programming Questions
Installation & Troubleshooting
Sensors

Thanks for your consideration!

Pages: [1] 2