Show Posts
Pages: 1 ... 22 23 [24] 25 26 ... 67
346  Using Arduino / Project Guidance / Re: help :6servos control on: March 15, 2013, 10:55:44 am
Bitlash ships with a multi-servo example as well.  http://bitlash.net

-br
347  Using Arduino / Programming Questions / Re: Editing the preferences.txt file on: March 14, 2013, 07:39:31 pm
What platform are you on?

-br
348  Using Arduino / Networking, Protocols, and Devices / Re: WiFi shield sending weird packets on: March 14, 2013, 02:33:22 pm
What did you capture the packets with?  Your Twisted server or another tool?

One thought would be to use something like the "nc" command or WireShark to make sure that fruit salad is on the wire and not introduced by something twisted in your Twisted server.

We can give you better answers here if you post your code.

-br
349  Using Arduino / Interfacing w/ Software on the Computer / Re: Interfacing issues with Python and Arduino on: March 13, 2013, 07:28:23 am
When you open the serial port, the Arduino resets into the bootloader and hangs out there for a short while to see if the PC wants to flash a new program.

So, if you send data too soon after opening the serial port, your data will be seen by the bootloader, not your program, which is not running yet.  This usually leads to symptoms like "Arduino doesn't see the command I sent to it", because the bootloader ignores what it can't understand and goes ahead and starts your program.  Which sits there waiting for the command that has already come and gone.

See if it works a little better if you delay a short while on the python side after opening the serial port -- I use time.sleep(2).

-br
350  Using Arduino / Programming Questions / Re: Code issue. Servo not moving while collecting IR sensor data. on: March 11, 2013, 07:30:05 pm
Congratulations, you have written your first buffer overflow bug.  Your code is reading and writing past the end of the memory you have allocated for it to use in the analogValues array.  Once you start writing to memory that is in use for other purposes, anything can happen, including things like your servos ceasing to work.

Define the array as int analogValues[20] and see if it helps.

-br
351  Using Arduino / Programming Questions / Re: Tips or Alternatives on: March 11, 2013, 06:54:43 pm
The expression ">>2" is "shift right 2 bits", which is the same as dividing by four (but sometimes faster).  You could say /4 and it would work the same way.

-br
352  Using Arduino / Programming Questions / Re: Code issue. Servo not moving while collecting IR sensor data. on: March 11, 2013, 06:42:06 pm
I don't know if this is your whole bug, but this array is way too small for the 20 values you later put in it:
Code:
int analogValues[0];

-br
353  Using Arduino / Programming Questions / Re: Tips or Alternatives on: March 11, 2013, 06:12:05 pm
Your sketch will compile to a smaller binary if you do the sensor scaling without floating point, using just integer arithmetic instead:
Code:
void loop() {
  analogWrite(ledPin, analogRead(sensorPin) >> 2);
  delay(20);
}
354  Using Arduino / Programming Questions / Re: Is this legal / safe programming? on: March 08, 2013, 03:09:41 pm
What you have there works fine, but you can save the one-step recursion with something like this at the top to override "data" if it's not set:

Code:
    if (!data) data = hitachi_hd44780u_a0_5x8_font;

-br
355  Using Arduino / Networking, Protocols, and Devices / Re: send data packet to serial on: March 08, 2013, 07:35:51 am
Returning the address of a local variable declared on the stack is bound to cause problems, because the memory it occupied on the stack is quickly reused.

Move the declaration of buffer[] out of the function to make it global and it should help.

-br
356  Using Arduino / Networking, Protocols, and Devices / Re: Playing with RFM12b on: March 07, 2013, 07:46:49 am
For easy debugging, you could put the Bitlash interpreter on the receiving device and send Bitlash commands to it from the transmitter. 

http://bitlash.net

-br
357  Using Arduino / Programming Questions / Re: Simple GUI for my Arduino on: March 05, 2013, 07:54:20 am
You might take a look at Bitlash Commander, which is able to do simpler versions of the control panel you've shown. 

https://github.com/billroy/bitlash-commander

Commander runs on the PC and serves web pages containing control panels you design.  The arduino can be connected by usbserial or ethernet; there is a sketch to handle either case in the Bitlash distribution at http://bitlash.net, or you can roll your own.

-br
358  Using Arduino / Sensors / Re: 23-minute "ticks" in sensor input??? on: March 03, 2013, 06:37:47 pm
There's a problem with variable allocation on the stack.

Does it still glitch if you move this line out of setup():
Code:
 byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;

And also delete the similar line from loop().  In other words, make all those byte variables global and see if it still glitches.

-br

Edit: On reflection I don't think there's a bug there.  Though it couldn't hurt to make them global, it probably won't help.


359  Using Arduino / Sensors / Re: 23-minute "ticks" in sensor input??? on: March 03, 2013, 05:57:55 pm
It would also help to see your code, while you're waiting for the glitch…

-br
360  Using Arduino / Sensors / Re: 23-minute "ticks" in sensor input??? on: March 03, 2013, 05:26:51 pm
Do the sensors hiccup if you keep them in the dark?

-br

Pages: 1 ... 22 23 [24] 25 26 ... 67