Show Posts
Pages: 1 ... 22 23 [24] 25 26 ... 67
346  Using Arduino / Programming Questions / Re: Language problem on: March 16, 2013, 07:06:27 am
Does it work if you say:
Code:
Serial.print(buffer);
…instead?

-br
347  Using Arduino / Displays / Re: Loading Image into an 7" TFT LCD from SD Card on: March 15, 2013, 02:21:43 pm
Code:
Location=ass;
Thanks for the laugh.

Yours is a prime candidate for the "bisecting the problem with Serial.print()" approach.  Find out what is working, and what isn't, using judiciously scattered logging.  If you feel lucky, start in the middle and work your way forward or back.

-br
348  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
349  Using Arduino / Programming Questions / Re: Editing the preferences.txt file on: March 14, 2013, 07:39:31 pm
What platform are you on?

-br
350  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
351  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
352  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
353  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
354  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
355  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);
}
356  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
357  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
358  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
359  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
360  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.


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