Archive

Archive for December, 2013

Searduino 0.7 released

December 30, 2013 Leave a comment

Download

Source code dist:

Binary dist:

GNU/Linux

News in 0.7

General changes:

  • LCD Support
  • Available in Java extenstions, Stream simulator, Jearduino
  • NOT available in Python extension

Jearduino:

  • LCD Support
  • Pin types now shown as Combo boxes

New arguments:

    • –arduino-code <FILE> – loads <FILE> for use
    • –board <BOARD> – sets <BOARD> to use
    • –start – starts your code as soon as it is loaded

New implemented API functions:

Math:

  • randomSeed(unsigned int seed)
  • random(long max)
  • random(long min, long max)

Liquidcrystal:

  • LiquidCrystal
  • begin
  • clear
  • home
  • setCursor
  • write
  • print

Bugs fixed:

  • Fixed changing pin types and modes (Leaonardo board)
  • Many more
Categories: Uncategorized

Partial LCD Support in Searduino (not complete, but ready for use)

December 28, 2013 Leave a comment

About Searduino (short version): C/C++ interface to your Arduino boards, build stand alone program for your local computer, run your Arduino code in a simulator. (Longer About)

The added LCD Support means you can play around with LCDs (2×16 characters) just as you can with physical Arduinos. We’ve tried to fake the behavior of “LCD Keypad Shield For Arduino” [1]. For a normal user (that is someone who does not want to write a simulator by her self) nothing needs to be done – it should work.

“Not much of the API is done – why bother to write about it?” – you may wonder!

We chose to blog about it early since need your help – join us!! 

Status

Update (Dec 29, 2013): Current status can be found here)

The LiquidCrystal API[2] offers the following functions (followed by Searduino’s implementation status

LiquidCrystal() - ok
begin() - ok
clear() 
home()
setCursor() - ok
write() - Coming up next
print() - ok
cursor()
noCursor()
blink()
noBlink()
display()
noDisplay()
scrollDisplayLeft()
scrollDisplayRight()
autoscroll()
noAutoscroll()
leftToRight()
rightToLeft()
createChar()

How to use them with Searduino’s two simulators:

You can run the example[4] that’s in the git repo.

cd example/lcd-shield
make -f Makefile.lcd-shield clean shlib

You should have a shared lib (lcd-shield.so) that you can load in Jearduino.

searduino-jearduino.sh

or as a separate program (using the default LCD functions):

make -f Makefile.lcd-shield clean prog
./lcd-shield

Jearduino

Jearduino is the GUI simulator frontend of Searduino. If you download the latest git[3] it’s all there ready to use, with a separate Panel for LCD.

Stream

Stream is the text based simulator frontend of Searduino. If you download the latest git[2] it’s all there ready to use, with a stdout printout of each LCD write.

How to use them in your own simulator:

C

uint8_t seasim_register_lcd_cb(lcd_to_sim_callback_ptr cb);
where lcd_to_sim_callback_ptr is defined as
typedef void    (*lcd_to_sim_callback_ptr)    (const char* str1, const char*str2);
so an example callback could look like this:
void
lcd_callback(const char *str1, const char *str2)
{
 printf ("LCD_CALLACK() LCD[0]: %s\n" , str1);
 printf ("LCD_CALLACK() LCD[1]: %s\n" , str2);
 fflush(stdout);  /*  MIND YOU, IS FLUSH REALLY NEEDED!!! */ 
}

Java

Implement:

SearduinoObserver

Call:

registerLCDCallback(this);

Add a callback, typically like this:

public void handleLCDEvent(String row1, String row2)
 {
 System.out.println("EVENT: LCD MESSAGE-------------> " + row1 + " " + row2 );
}

Python

Not implemented yet

… and if you’ve read this far you might as well join us

[1] http://www.dfrobot.com/index.php?route=product/product&product_id=51#.Ur1i1pCJDAQ

[2] http://arduino.cc/en/Reference/LiquidCrystal

[3] http://git.savannah.gnu.org/gitweb/?p=searduino.git;a=summary

[4] http://git.savannah.gnu.org/gitweb/?p=searduino.git;a=blob_plain;f=example/lcd-shield/lcd-shield.cpp;hb=HEAD

Categories: Uncategorized