Simulating the LCD on PC - in progress

FYI, I am developing a way to simulating the functions of LCD (LiquidCrystal library) on a PC. This is relevant to those with some programming experience (c/c++/java etc.) on a PC (win/mac/linux) and can set up proper files and options to link library to your project code. The central purpose of this exercise is to simulate all non-hardware related code on PC for faster speed (no upload), use of debugger, and support of a better IDE for longer programs. Then with fully debugged code on PC, one can in principle copy paste to arduino and expect it to run on arduino. There are countless times where I ran into say using pointers without assigning a value and used it in arduino and it "worked". But on a PC, an exception will be thrown and I will investigate it and fix the code.

I am also making various arduino functions including PROGMEM stuff to work on PC by simply modifying Arduino.h

If you are interested, please read this post for updates and a list of currently supported functions in my little experiment.

http://arduino.cc/forum/index.php/topic,96197.0.html

liudr:
FYI, I am developing a way to simulating the functions of LCD (LiquidCrystal library) on a PC. This is relevant to those with some programming experience (c/c++/java etc.) on a PC (win/mac/linux) and can set up proper files and options to link library to your project code. The central purpose of this exercise is to simulate all non-hardware related code on PC for faster speed (no upload), use of debugger, and support of a better IDE for longer programs. Then with fully debugged code on PC, one can in principle copy paste to arduino and expect it to run on arduino. There are countless times where I ran into say using pointers without assigning a value and used it in arduino and it "worked". But on a PC, an exception will be thrown and I will investigate it and fix the code.

I am also making various arduino functions including PROGMEM stuff to work on PC by simply modifying Arduino.h

If you are interested, please read this post for updates and a list of currently supported functions in my little experiment.

http://arduino.cc/forum/index.php/topic,96197.0.html

I saw the other thread; skimmed it, really (so if the following was addressed, my apologies): Will this project be cross-platform - that is, can we expect love for Mac and Linux users? :slight_smile:

cr0sh,

Good question!

At the moment I am using the windows console buffer status info to control the movement of the LCD cursor, the windows Sleep to do the delay, and the windows FILETIME to derive time. It's a result of awesome internet search hits like "how to do delay in windows" :slight_smile:

I am pretty sure a port can be done with ANSI console (I prefer this than windows console) using escape sequence (I'm already using this in my phi-panel instructions), some generic Linux Sleep/delay, and epoch time (right term?) with linux. The rest is OS-independent. Since I don't have Mac or Linux, I'll need to enroll some help from those that do. Are you saying you're interested in checking out the project or maybe contributing a bit at various levels? From testing to porting. :slight_smile:

BTW, I was looking for a way to replace windows console with ansi console for Dev C++ but didn't find how to do it yet. If I do, I will port the LCD into using ANSI escape sequence.

I'll make a video if I have time tonight :slight_smile:

BTW, I was looking for a way to replace windows console with ansi console for Dev C++

I fiddled a bit with that some time ago, and found a program named "ansicon" that I ran with my program as argument. I didn't find that webpage now (old, nonexistant geocities page). A quick google came up with something similar, if not the very same: GitHub - adoxa/ansicon: Process ANSI escape sequences for Windows console programs.

If it's the same I used, you need to have ansicon.exe and ansi.dll (now updated to ansi32.dll it seems, read the readme) in the PATH environment variable, or in the current directory where you run your program from.

Hope that helps.

Also, just in case, although rather unlikely, here is a (very old) explanation of how to use ansi.sys in windows NT: http://www.nthelp.com/40/ansiNT.htm.

Thanks raron! I'll look into those.