Pages: 1 [2]   Go Down
Author Topic: Any interest in running arduino code on PC, partially?  (Read 3731 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Online Online
Tesla Member
***
Karma: 65
Posts: 6939
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Same here. We are testing emulator, not simulator. If what we do (non-hardware related code) can run on PC, it will be much easier to debug and port back to arduino hardware. It's good to know though that you have a simulator in a good shape already. This will come in handy when time-critical things needs to be simulated and slowed down for developers to see what's going on.
Logged


Central MN, USA
Online Online
Tesla Member
***
Karma: 65
Posts: 6939
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I made some additional functions for this simulated environment by adding a DS1307 class. The class was created by Matt Joyce (matt.joyce@gmail.com). I took its shell and bashed in windows stuff. Nice to see the PC time change from my simulated environment running phi_prompt menus and lists.

New list of working pieces:

millis();
microSeconds(); //Good luck with this on a multitasking operating system!
delay();

PROGMEM related definitions and functions. Seems to be working with "c-strings in PROGMEM and a pointer array in PROGMEM to point to these strings". I have not tested other data types. Be careful with this though, pitfalls may still exist
strcpy_P();
strlen_P();
strlcpy(); // This is only available with GNU C not a standard one but I need it.
pgm_read_byte();
pgm_read_word();

LiquidCrystal library. Will work on write(char), print(int) and print(float)

Everything except for below functions, which I don't use
        void noDisplay();                                                         ///< Turns off the display
        void display();                                                           ///< Turn on the display
        void scrollDisplayLeft(); // Hate these scroll functions. Useless
        void scrollDisplayRight();
        void leftToRight();
        void rightToLeft();
        void autoscroll();
        void noAutoscroll();
        void createChar(uint8_t, unit8_t*); // I can't create char on PC

DS1307 all working except for this one I didn't implement. Easy to do though. Also start and stop have no actions. You can't change DOW without changing dates.
    int get(int, boolean);

phi_interfaces input device library only has the phi_serial_keypads class which takes inputs from keyboard. Function keys are wsadfg of course (who didn't play some FPS games?)

phi_prompt user interface library works except that the right arrow looks different and the scroll bar is not as awesome as on real LCD

Will attach code and a sample once I get one done.
« Last Edit: April 15, 2012, 11:17:30 pm by liudr » Logged


Pages: 1 [2]   Go Up
Jump to: