Loading...
  Show Posts
Pages: [1] 2
1  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.4 for Windows (installer, drivers, etc) +SRC on: April 02, 2013, 01:33:46 am
Great work, thank you very much.
2  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.4 for Windows (installer, drivers, etc) +SRC on: March 18, 2013, 02:45:50 am
Try this:

enter this into the IDE:

Code:
int blah;                                        // some comment

Now delete the comment starting with the //.

Code:
int blah;                                       

If you press POS1 your cursor jumps to the begin of the line.

Code:
|int blah;                                       

If you press END your cursor jumps to the end of the line.

Code:
int blah;                                       |
3  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: March 17, 2013, 04:11:00 pm
How this looks to reset your arduino in Siberia from Hawaii?:

Love it!
4  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: March 17, 2013, 04:08:11 pm
Hi, I was trying to add this but noticed that this already works in the version 1.0 or newer.

Can you check this?

- starting IDE 1.0.3.
- file blink
- deleting comment in last line beginning with the "//"

Now if you press POS1 and then END, you end at the old start of the comment. Lots of spaces.

Press Ctrl-T.

As bevor, POS1 and END positions after a lot of spaces...


5  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: February 20, 2013, 01:08:08 pm
Type any line of text, then hold the space key. It will add spaces at the end of the line.   smiley

It does no do any harm to keep them there, but I find it annoying. So I like to clean up. Especially if I release code.

Notepad++ -> TextFX -> Trim Trailing Spaces does it for me.
6  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: February 19, 2013, 05:29:07 am
PS: I will try to add the new features.

In case you run out of idea: a "remove trailing spaces" pre pass could be added to the auto format source code.
7  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: February 14, 2013, 02:50:16 am
Reset board when serial monitor opens? or via another way? what do you think? will be a setting in preferences.txt enought?

A "Reset" Button placed on the Serial Monitor window would be far more elegant.
8  Development / Other Software Development / Re: [MOD] Arduino Enhanced Release 1.0.3 for Windows (installer, drivers, etc) +SRC on: February 13, 2013, 06:06:44 pm
If you need that bug, you can replace the rxtxSerial.dll file with the one from the official IDE package

Just to voice another vote for keeping a way to reset the board by a IDE switch.

In my case I do remote development (sitting in my warm room with the arduino some miles away I a cold garage) and I love the reset feature.
9  Forum 2005-2010 (read only) / Troubleshooting / Re: use Watchdog to restart / reset on: December 13, 2010, 02:11:03 pm
This means: no way to implement my idea without bootloader change?
10  Forum 2005-2010 (read only) / Troubleshooting / use Watchdog to restart / reset on: December 13, 2010, 12:09:05 pm
Hi,

I have a well working Arduino application. "Well working" means that it runs and runs and runs. No lock up and other annoyances, runtime greater some weeks without problems.

As designed it writes data into a (serial attached) tracking device, so I see power outages etc. by writting out messages during setup().

I thought about adding a watchdog to catch the situation that are not handled... My idea was to do a reset and write something into the log file if timer expires.

After reading some forum entries about the watchdog I'm quite sure that I don't understand the watchdog function.

My code looks like that:

Code:
void setup() {
  wdt_enable(WDTO_8S);
  wdt_reset();

  pinMode(ledPin, OUTPUT);
  addtask(blinker);
}

void loop() {
  taskswitcher();
  delay(10000);

  wdt_reset();
}

(task manager is a simple sheduler, blinker should blink like in blink-demo)

At runtime I see it wait and then the led starts to blink really fast.

Any help to enlight me? Thanks!
11  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Suggestion: add simple multitasking to the stdlib on: December 14, 2010, 04:05:12 am
I was in need for a task switching thingy, too. So I took the above code as an inspiration. I changed the following:
  • longest wait time now unsigned long (longer wait than 32s)
  • removed the sorting of the task list
 (is it really needed to have a sorted list? is it faster than looking up?
   qsort costs about 1,5k, so I think: no)
  • changed task indexer to byte
  • appendTask does not add to many tasks...
  • at least handle the millis()-overflow somehow
So I got a small little piece of code that lives well in a IDE-TAB and can be compiled with only adding one line of code (due to some Arduino IDE limitations).

Now it would be a good idea to optimize the wait-while-loop. Something like "let it sleep" or so.

Comments welcome.


Code:
#define maxtasks 10

// Die Task-Struktur
struct Task {
  unsigned long time;
  unsigned long (*func)();
};

struct Task tasks[maxtasks];
byte tasksLen = 0;

void appendTask(unsigned long (*func)()) {
  if (tasksLen<maxtasks) {
    tasks[tasksLen] = (struct Task) {
      millis(), func
    };
    tasksLen++;
  }  
  // und wie kriegt man mit, dass es zu viele Tasks sind?
}


void runNextTask() {
  byte t;
  static unsigned long lastmillis = 0;

  // overrun detect
  if (lastmillis>millis()) {
    // reset all times.
    for (byte i=0;i<tasksLen;i++) {
      tasks[i].time=0;
    }
  }
  lastmillis=millis();

  if (tasksLen > 0) {
    t=0;

    for (byte i=0;i<tasksLen;i++) {
      if (tasks[i].time<tasks[t].time) {
        t=i;
      }
    }

    while (tasks[t].time > millis()) {
      // pass
    }
    tasks[t].time = tasks[t].func();
    tasks[t].time += millis();
  }
}

Blink looks like this

Code:
const int ledPin = 13;

// this should not be needed and been catched by Arduino... but it isn't.
void appendTask(unsigned long (*func)());

unsigned long blink() {
  digitalWrite(ledPin, ! digitalRead(ledPin));
  return 1000;
}

void setup() {
  pinMode(ledPin, OUTPUT);
  appendTask(blink);
}  

void loop() {
  runNextTask();
}
12  Forum 2005-2010 (read only) / Syntax & Programs / Re: control the Build Order on: December 14, 2010, 01:58:10 pm
I know.

Problem (or challenge) is to keep the requirements at a low level. It's an educational project and the students have almost no knowledge about anything.

And adding multiple file types into the game shall be the next step. Currently we are busy with understanding why we need to spilt things in reusable parts and how to design it in a resuable way.
13  Forum 2005-2010 (read only) / Syntax & Programs / Re: control the Build Order on: December 14, 2010, 01:23:51 pm
I thought about that.

But than I have to edit at two (or even more) locations, if I change something.
14  Forum 2005-2010 (read only) / Syntax & Programs / Re: control the Build Order on: December 14, 2010, 10:47:14 am
Hu, code, really?

In one.pde I have
Code:
int something;

And in my other.pde I want to do
Code:
void nana() {
  something++;
}

THis compiles, if  one.pde is merged in front of other.pde. It does not compile, if other.pde is merged in front of one.pde.

I don't want to change the code, I want to control the order or merging.

Addendum: it looks like the merge order is the same as the order of the open tabs. And the open tabs are ordered alphabetically. So I will change my filenames to meet the order I need.
15  Forum 2005-2010 (read only) / Syntax & Programs / control the Build Order on: December 14, 2010, 10:37:24 am
To make my project more structured I try to divide the parts into multiple TABs inside the Arduino IDE. Current decision is to use a multi file sketch with no extension (so files have the .pde extension).

According to http://www.arduino.cc/en/Hacking/BuildProcess these sketches are concatenated together.

I have problems with variable declarations needed in earlier parts that are merged as later parts (making the compiler unhappy).

I don't really want to switch to .h/.c stuff. Do I have any chance to control the order of this merge process?

Pages: [1] 2