Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Moveing from the breadbox on: March 08, 2013, 09:32:28 am
So I designed a project and written the code and it all works* but then comes the interesting step of acctually makeing the project in real-life with caseing etc. If I think correctly (that does happend), I need to solder parts onto somekind of caseing with opening for electricity or batterys and mount the Arduino in it (and considering I am going for portable and small battery driven sounds good oh and a Nano), this should be the next step ,well finding what to mount it in that look cyberpunky enough as that the feeel the project wants, maybe time to try to find something in the electronic trash in the house I work at.



*= Acctually I haven't but this is more of a , I know thats where the trouble starts as the hacking code and wireing on breadboard is not much of a problem, I just need to get the next months paycheck.
2  Using Arduino / Programming Questions / Re: Help me, File.read() won't work. on: March 08, 2013, 05:35:43 am
But if thats true he should set c="0" after the loop to have the same effect?

Bit late "after the loop". That's like locking the stable door after the horse is stolen.

Your right, I meant at the end of the in loop loop. eh, as in the end of loop(). Of course he could posibly use free to remove the memory space? (If I remember my allocing and freeing memory in C correctly)
3  Using Arduino / Programming Questions / Re: Help me, File.read() won't work. on: March 05, 2013, 10:03:52 am
Quote
Apperently an empty char contains a new line.
No. A global char is initialized to a NULL. A local variable is not initialized. It contains whatever crap was last written to the memory location that the variable is assigned to.

ah yes , that was what I meant to formulate (well I did not know that the global variable auto-set to NULL.

But if thats true he should set c="0" after the loop to have the same effect?
4  Using Arduino / Programming Questions / Re: Is there a better way than using sprintf to format my data. on: March 05, 2013, 06:49:59 am
I wonder if you might explain that to me as I understand all I am doing is constructing a single json string containing multiple key value pairs?

JSON stores values in arrays, while your C code indeed sets it all to one string, thats not how JSON is meant to work.  If you store it as a string you are not really takeing advantage of what JSON gives you.

[q="json.org"]
    A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
    An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
[/quote]

in C/C++ I would use an array for it, or perhaps a struct. A string in C is an array.

My structure starts and ends with braces, and has no other braces or brakets within to suggest it is an array containing arrays.

 I mean to say that it would be more usefull if it was an associative array (or a class with objects) as thats how JSON kind of is supposed to be used. There is a few C/C++ libaries to handle JSON to, but I don't know if there is any Arduino specific ones


Going on what AWOL was saying, I have just tinkered with the following method;

(Code deleted)
That is much better then you start yes. And it might be more memory effecient then other methods.

5  General Category / General Discussion / Re: Is Arduino for me? on: March 05, 2013, 05:34:27 am
I'm a college student, and I'm interested in learning basic programming.

While Arduinos are awesome fun (I wish they had thoose when I went to school, maybe I had gone to class then) I don't get if you just want to learn to program where I would say that it would be more usefull to get a book on any programming language really or if you acctually want the hardware part that the Arduino gives you.

(Acctually you might want to pick up a book on C/C++ too anyway)
6  Using Arduino / Programming Questions / Re: Writing in to excel sheet on: March 05, 2013, 05:30:37 am
It is not impossible, just very hard and demands some extra components it seems. At least at a quick glance on this link http://social.technet.microsoft.com/Forums/is/ITCG/thread/ccdaded5-fb27-42a2-85e2-eca8aab4037e

That said I think method 2 above is the way to go
7  Using Arduino / Programming Questions / Re: Help me, File.read() won't work. on: March 05, 2013, 05:25:55 am
Even if you don't define any value to a variable does it means it contains nothing. Apperently an empty char contains a new line.  ( A variable is just something that says look at this memory space and see what it contains, well not exactly but almost)

It really is a good practice to always set variables to something, espacally on limited memory machines IIRC
8  Using Arduino / Programming Questions / Re: Is there a better way than using sprintf to format my data. on: March 05, 2013, 05:22:27 am
You do know you are putting many arrays (JSON) into one array? It might be a bit of a memory issue on the Arduino to make an vector array but that would make it easier to access and also make it possible to loop through it more easily.
9  Using Arduino / Programming Questions / Re: from Arduino to a local host on: March 02, 2013, 09:10:38 am
Quote
In networking localhost just refers to the local machine, whatever it is.
But, generally, the term is used to refer to the local machine as the server, when pointing a web browser to a web server.

You need to have something like Apache installed on the PC that you want the Arduino to send data to. Apache, PHP, and MySQL play well together, and are collectively referred to as LAMP (for Linux) or WAMP (for Windoze). I'm not sure what the equivalent is for the Mac, being a Mac owner for less than 24 hours.

AFAIK PHP can't read /dev/ streams, I think that with a Perl script running as CGI on Apache etc could listen to /dev/[USB]  and then output stuff (It might be possible in PHP I just feel like PHP is much much much less then Perl, oh and in theory he could write the CGI in C).

But we would need to know if he have a webbserver setup etc
10  Using Arduino / Project Guidance / Re: Project advice: what in the world should I build?? on: March 02, 2013, 04:05:05 am
Quote
Lots of computer knowledge (IT admin).

This just wont help you at all. Programming a micro controller is as far from IT Admin as you can get! So go for something simple(ish) and then have lots of fun.

Mark

That really depends, some of us have to code a lot of things to help with the admin stuff and sometimes hack hardware too...

As long as microcontrollers stay away from assembler I wouldn't say it is that long away. It's still logic
11  Using Arduino / Programming Questions / Re: from Arduino to a local host on: March 02, 2013, 03:56:32 am
If I understand your question correctly and you want to output data from the Arduino and then display it via a webserver and considering what the other person says, what you need to make happen is to have an interface that listens to serial communication and then forwards it to a script running on the webserver.

As far as I know this should be possible (but I only got my Arduino two days ago)
Pages: [1]