Show Posts
Pages: [1] 2 3 ... 67
1  Products / Arduino Due / Re: Bitlash 2.0 RAM configuration on: October 09, 2014, 06:56:16 am
What would you like to use additional ram for?

2  Using Arduino / Displays / Re: bitlash + Normal Hitachi HD44780 Compatibe LCD (4x20) + PS2 Keyboard on: July 13, 2014, 06:41:58 am
The setOutputHander() function tells Bitlash: "Here is the function you should use to print an output character."  You pass it a function that takes a single character as an argument.  Your function takes the character and does whatever you like with it: print it to an LCD, send it over the internet, save it to EEPROM, whatever.

There is an example showing how to use setOutputHandler in the "loudbitlash" example folder.  The example simply makes every printed character uppercase.  Instead, you could replace the uppercasing code with code to print to your lcd.

There is also a serial LCD example that may be more appropriate for the topic of this thread.

Have a look at the examples and see if that helps puzzle it out.

3  Using Arduino / Programming Questions / Re: bitlash - how to deceleration input string to function on: June 02, 2014, 09:28:32 am
Getarg returns a numvar, but you can cast the result of getarg to another type:

    char *foo = (char *) getarg(2);

4  Using Arduino / Programming Questions / Re: Download file via HTTP-request/response on: January 21, 2014, 07:42:09 pm
Try leaving out the Content-length: header line entirely.  It is optional in the HTTP spec.

The bitlash web server doesn't send content-length:

Be sure to close the client connection after writing your last byte, since this is the only way the other end will have to know the response body is finished.

5  Using Arduino / Programming Questions / Re: Download file via HTTP-request/response on: January 20, 2014, 05:11:03 pm
Headers must have a colon separating them from the rest of the line.

Try this:
Content-disposition: attachment;filename="myfile.csv"

6  General Category / General Discussion / Re: Morse Code blinker on: December 15, 2013, 07:35:05 am
For reference and discussion, here is an implementation of an Arduino Morse code generator that uses an array to specify the letter signatures:

The m() define is used to pack both the dit and dah elements (as 0 and 1) and the length of the character in elements into a single byte in the array. 

Using three bits for the count leaves room for five Morse elements.  This handles most cases, but because there are several Morse characters with six elements, there is also an overflow table (outliers) to define those characters.

7  Using Arduino / Microcontrollers / Re: Linking Arduino with Ubuntu without the Arduino's IDE on: November 24, 2013, 10:28:56 am
When you open the serial port, the Arduino resets and enters the boot loader to see if you want to upload a new program.

If you send data during this interval, it is eaten by the bootloader, because your program hasn’t started yet.  This is likely what is happening for you.

Try waiting one or two seconds after opening the serial port before writing to it.  That will give the bootloader time to time out and start your program.

Even better would be to wait for a “ready” signal from the program itself.

Hope that helps,

8  Using Arduino / Programming Questions / Re: bitlash without serial port on: November 16, 2013, 06:45:59 am
Happy to try to help.  I read the translation of your Russian page and it looks like an interesting project.

Could you please post your code, at least the sketch that is using Bitlash?  And it would be helpful to have a little more information about  the problem:  what is the test situation, what do you expect to see, and what are you actually seeing?


9  Using Arduino / Networking, Protocols, and Devices / Re: Arduino serial messaging protocol on: November 03, 2013, 07:43:24 am
Thanks for your post, and for sharing your project.  It's an interesting problem, isn't it?  

The approaches taken by Arduino-serial-messaging and Firmata are both valid and effective, but may I suggest you also consider Bitlash?  (   Bitlash is an interpreted language that runs on the Arduino and provides the affordances of a mini development environment.  Having a development capability on the device offers arbitrary extensibility at run time, and the control "protocol" is just statements in the Bitlash language, sent from the PC.  This offers excellent visibility into the communication flow, without special tooling, which is arguably a strong plus in an educational environment.

Bitlash is syntactically a stepping-stone to C, is easy to teach, and easy to learn.  If distributed system design is part of your curriculum, it puts enough remotely-programmable intelligence on the device that you can explore a spectrum of options as to partitioning functionality between the PC and the endpoints.

Documentation at, code at

Kind regards,

10  Using Arduino / Project Guidance / Re: bitlash and rcswitch library on: October 12, 2013, 03:04:36 pm
Cool project.  The interrupts shouldn't have any effect on Bitlash except to slow it down a wee bit.  So you should be okay.  Same for reading from the SD card.

Good luck with your project,

11  Using Arduino / Programming Questions / Re: How to restrict Arduino webserver to respond only to particular web site on: September 29, 2013, 03:45:09 pm
The information you need is sent in what is called the "Referrer header":

The browser includes this header in the HTTP request to the server when it fetches a page in response to a click on a link.

You can read and parse the Referrer: header data from the HTTP request to your Arduino and confirm it matches the domain you wish to limit access to.

12  Using Arduino / Displays / Re: bitlash + Normal Hitachi HD44780 Compatibe LCD (4x20) + PS2 Keyboard on: September 14, 2013, 06:47:58 am
I am the author of Bitlash and would be glad to help.

To integrate the keyboard input, send each character your keyboard driver receives to the Bitlash "doCharacter(char c)" routine.

To integrate the display output, you can use "setOutputHandler(&yourDisplayHandler);".  This redirects all of the Bitlash serial output to the function you specify.  Output is sent one character at a time.  The loudbitlash example shows a simple case using setOutputHandler.

Hope that is helpful, and good luck with your project,

13  Using Arduino / Programming Questions / Re: Going back to loop after hardware interrupt on: July 29, 2013, 08:29:59 am
Checking a global flag and exiting in the innermost loop of your pattern generators is the best way to cleanly transition between patterns.

If you really want to kludge the restart, look into using the watchdog timer to reboot the processor, and use the EEPROM to save which pattern you want for the next boot cycle.


14  Using Arduino / Programming Questions / Re: Delayed response from webservers action driven links on: July 06, 2013, 06:48:14 pm
This may not be the bug you're after, but it looks like a problem:

       if (currentLine.endsWith("GET /LS") == 1 || currentLine.endsWith("Get /LS") == 1){

        if (currentLine.endsWith("GET /L") == 1 ||02 currentLine.endsWith("Get /L") == 1) {

An input ending with "GET /LS" will fall into the first case, and then also fall into the second case.  Which may not be what you want.

Shouldn't that whole sequence be a chain of if-else if tests, so that only one is executed?


15  Using Arduino / Programming Questions / Re: want to start using millis for non-blocking - which of the libraries is best ? on: July 05, 2013, 06:28:27 am
Not Mary, but I do have a simple library to offer:

The advice to roll your own is good advice, but it never hurts to look at another implementation.  Use that code for ideas.

Good luck with your project,

Pages: [1] 2 3 ... 67