Hey all. I've only been using Arduino for a few weeks, but I've been successful in my results. I'd like to investigate front ends now, and I was looking at this page - Arduino Playground - InterfacingWithSoftware. It talks a lot about controlling your Arduino, but what I would want to do is actually re-write the sketch based on the input of the front end. Maybe that functionality is there and just not apparent to me, or maybe that method should never be necessary and I'm thinking about it all wrong. Any advice/direction is appreciated. Thanks!
cbowen:
but what I would want to do is actually re-write the sketch based on the input of the front end.
You need to explain more clearly what you want to happen.
The only way to change any part (front or back) of an Arduino program is to re-compile the program and upload the new version to your Arduino board. You cannot change part of the program that is on the Arduino board, you can only replace the complete program.
You could write a program that does different things depending on messages from your PC or user inputs via push buttons.
...R
You could front-end the AVRDUDE uploader which Arduino uses to upload new sketches to the board. The Arduino IDE is just a front-end itself.
But it sounds more like you just need to define all the tasks which you want your Arduino to do and then define a simple way for your PC program to command the Arduino to begin each task.
Thanks for the reply guys. So, basically on the front end you'd click and define parameters for LED's. Since the front end wouldn't be able to tell when to use loops and make the code efficient, i figure it would define parameters for every LED, every time there's a state change anywhere on the strip. So, make a front end to define all the LED parameters over some period of time. Then tell it to write all that to a new sketch.
The closest thing I can think of to what you're asking about is the visual programming front ends for Arduino. These allow you to create a program by drag and dropping "blocks" but those blocks are translated into the standard C++ sketches before they are compiled and uploaded to the Arduino board. There are several options for visual programming Arduino but I haven't used any of them so I can't recommend one.
I don't think this is really what you need though. I think you're looking for something like Firmata, where you have a general, all-purpose program running on the Arduino board which is controlled from a front end.
Efficient should be your last priority. The Arduino is considered to be very slow but it can still do 16 million instructions per second. About 15.9 million of those will just be waiting for you to push a button.
It never gets bored asking "Are we there yet?" millions of times per second. Write your code to do that and you'll have a good result.
Tell us more about your project. At this point we know you have LED's and a strip of something (which might be LEDs).
cbowen:
Thanks for the reply guys. So, basically on the front end you'd click and define parameters for LED's. Since the front end wouldn't be able to tell when to use loops and make the code efficient, i figure it would define parameters for every LED, every time there's a state change anywhere on the strip. So, make a front end to define all the LED parameters over some period of time. Then tell it to write all that to a new sketch.
This is still not clear. You are "waving" the phrase "front end" around without explaining what you mean by it.
I think what you are saying is that you want to have some PC program that can send data to the Arduino to tell the Arduino which LEDs should light. If so that is a very common thing.
For receiving data on your Arduino have a look at Serial Input Basics - simple reliable ways to receive data.
If you need help writing a PC program you should look on Forums dedicated to that. This Python - Arduino demo may help get you started.
...R
can you define what you mean by front end a little more ? Robin2 is right, we are not really able to follow.
at one point, it sounds like the PC software in which you write code before uploading.
"So, basically on the front end you'd click and define parameters for LED's."
To me, when you use your mouse to click on a thing, that is in software on the PC
at another point, you talk about some how creating a whole new program automatically.
at another, it seems like you want to change things.
"So, make a front end to define all the LED parameters over some period of time. Then tell it to write all that to a new sketch."
if you have, say 10 switches and 10 buttons and you want button 3 to light LED 6 on one day, but light LED7 on a different day, that is not done is setup, but in more of s State Machine or such.
I think that what you mean by 'front end' is not clearly understood by the rest of us.
A compiler typically has a front-end for every recognized programming language and a back-end for every supported machine, and translates literal input into machine code.
This concept could be extended into another form of a compiler, that translates any (literal, graphical...) input into source or machine code.
DrDiettrich:
A compiler typically has a front-end for every recognized programming language and a back-end for every supported machine, and translates literal input into machine code.This concept could be extended into another form of a compiler, that translates any (literal, graphical...) input into source or machine code.
when you read post#3 with this perspective, does it make sense ?
Thanks for your food for thought
A specialized editor is more part of an IDE than of a compiler. That part is traditionally called a User Interface (UI).
DrDiettrich:
A specialized editor is more part of an IDE than of a compiler. That part is traditionally called a User Interface (UI).
The problem is that we have no idea whether the OP is talking about an editor or a user interface.
...R
Here I consider the editor and UI the same - every editor needs an UI.
DrDiettrich:
Here I consider the editor and UI the same - every editor needs an UI.
I was thinking of a user-interface for the running program - and it is possible that is what the OP is talking about.
...R
For data presentation and transmission Processing can be used.
"Front end to rewrite sketch" That's the IDE. It uses something like c++. Unless you would like to come up with your own language, possibly a graphic language? Or a push button & switch language? Is this what you are asking for?
-jim lee
cbowen:
So, make a front end to define all the LED parameters over some period of time. Then tell it to write all that to a new sketch.
You can send your parameters to an Arduino board that runs an existing sketch; the sketch needs to understand what you're sending and what to do with it. You do not need to create and send a new sketch to the board every time that a parameter changes.
Maybe you can compare it with a TV set or radio; when you tune it, it does not write a new application that contains the frequencies, it stores the frequency information in e.g. EEPROM so it's not lost after a power cycle.
You will need enough memory to store the parameters. That memory can be the internal RAM or internal EEPROM, or it can be external EEPROM (or the likes) or an SD card.
It's a very long time since we had any input from the OP
...R