Show Posts
Pages: 1 ... 21 22 [23] 24 25 ... 67
331  Using Arduino / Project Guidance / Re: running bitlash scripts from the arduino on the arduino without serial input on: March 20, 2013, 06:32:35 pm
PeterH has it right: you define a Bitlash function named "startup" to run anything you want to be started up at boot time.  Here's an example:

// Blink:
function t13 {d13=!d13}
function startup {pinmode(13,1); run t13,500}

You can see lots of short bitlash programs with examples of startup functions here:


332  Using Arduino / Programming Questions / Re: Programing error with stepper/photocell on: March 20, 2013, 05:29:07 pm
It's the semicolon:
  if (state == DAY);
Remove it there, and anywhere else you use it after an "if" or "else" with brackets.

333  Using Arduino / Programming Questions / Re: Having trouble with millis() on: March 20, 2013, 05:09:36 pm
I'm afraid it is not possible to provide good help without seeing all your code.

334  Using Arduino / Programming Questions / Re: Having trouble with millis() on: March 20, 2013, 04:40:09 pm
So when I edit your code down to the readable minimum, this is what I get:

boolean stageTempReached = false; //has the temp been reached for this stage, starts out as no
boolean timer = false;  //is the timer running because the temp has been reached?
byte Stage = 1;
unsigned long timeStart;

void setup() {

void loop() {
clockCheck (10);
delay (1000);
//Subroutine that checks time since the correct temp was reached
//and changes to the next stage if needed
void clockCheck (int minHold) {
if (stageTempReached && !timer) {
timeStart = millis();
timer = true;

Since nothing ever changes stageTempReached, what are you expecting?…

335  Using Arduino / Programming Questions / Re: Having trouble with millis() on: March 20, 2013, 04:27:35 pm
Would you post the updated code, and include it inside code tags? 

The little "#" button above the smilies above the edit window will add code tags for you.

336  Using Arduino / Programming Questions / Re: Having trouble with millis() on: March 20, 2013, 04:18:59 pm
timeStart needs to be a global to persist from run to run of clockCheck.  It is currently declared inside clockCheck, so it's local to clockCheck (and therefore contains uninitialized garbage sometimes).

Move the declaration of timeStart above the start of the clockCheck function to make it global and see if that helps with your problem.

337  Using Arduino / Programming Questions / Re: Not seeing any serial output after some additions to code: debugging code added on: March 20, 2013, 10:06:45 am
First possible cause to eliminate is RAM starvation, presuming you are on a '328.  The code has a lot of string constants that are using up RAM.  If it's not the cause of your current bug, it will become a problem soon enough.

Search the forum for how to use the F() macro, which moves strings to PROGMEM (flash memory).

Also search for "free ram" and you'll find code that will tell you how much RAM is free.  If you don't have a few hundred bytes free for the stack, including any local variables you declare in your deepest call path, your program may run out of room.

338  Using Arduino / Displays / Re: Sparkfun LED Matrix backpack Project on: March 18, 2013, 07:29:29 pm
I published a library named TextWhacker with an example script for that display backpack.  You could use it as another test generator from the Arduino side.  Code is here:

It does require you also install Bitlash, which is here:

Good luck with your project.

339  Using Arduino / Displays / Re: Sparkfun LED Matrix backpack Project on: March 18, 2013, 06:54:44 pm
The power up animation tells us you have power and ground correctly wired.

The failure to run the SparkFun example code would suggest re-checking the wiring, especially MISO and MOSI.  If you have access to an oscilloscope, watching the signals on SCK/MISO/MOSI can help diagnose misconnections.

Also, if you are using an Arduino Mega, be aware the SPI pins are on different pin numbers.

340  Using Arduino / Sensors / Re: 3D data plotting problem on: March 18, 2013, 05:20:16 pm
At that link, it says:

(You will probably have to edit the file first and change the definition of ser to match the COM port your Arduino is using.)

341  Products / Arduino Due / Re: Arduino Due libraries (official and 3rd party) on: March 18, 2013, 04:25:24 pm
Bitlash is confirmed up and running on the Due, thanks to patches submitted by a friendly user.

Regards to all,

342  Using Arduino / Programming Questions / Re: serial motor direction problem on: March 16, 2013, 04:14:59 pm
Many of the variables that participate in the calculations in updatePid() are declared as integer.  I wonder if that's leading to integer arithmetic artifacts that you aren't anticipating, like overflow and underflow (particularly with integrated_error).

Does it work better if you make the whole calculation chain floating point by declaring the intermediate variables as float instead of int?


Edit: the judicious use of Serial.print() to log values may also help if you can manage that in your prototype.
343  Using Arduino / Programming Questions / Re: Compute Serial Transmition on: March 16, 2013, 09:35:44 am
The Bitlash interpreter can do the arithmetic and serial i/o and parsing part.  Bitlash comes with ethernet client examples for TCP (telnet) and HTTP that you could use as a starting point for a UDP client.

See for code, doc, and examples.

344  Using Arduino / Programming Questions / Re: Language problem on: March 16, 2013, 07:06:27 am
Does it work if you say:

345  Using Arduino / Displays / Re: Loading Image into an 7" TFT LCD from SD Card on: March 15, 2013, 02:21:43 pm
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.

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