This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "krobot".
The branch, master has been updated
via 94e87a11b68b9753ed5725e75bec5b8298cbe67b (commit)
from 1d5ebfa1823c3bccc8dbd250c9b231aaedaa7887 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 94e87a11b68b9753ed5725e75bec5b8298cbe67b
Author: Jérémie Dimino <je...@di...>
Date: Mon Mar 8 11:44:14 2010 +0100
Use LCD commands instead of the send function
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/driver/driver.ml b/PC_Mainboard/driver/driver.ml
index 121618b..7988333 100644
--- a/PC_Mainboard/driver/driver.ml
+++ b/PC_Mainboard/driver/driver.ml
@@ -84,20 +84,21 @@ struct
OL_method SetLCD : string list -> unit = fun dev lines ->
if List.length lines > 4 || List.exists (fun line -> String.length line > 20) lines then
invalid_arg "SetLCD"
- else
- match lines with
+ else begin
+ lwt () = Unsafe.clear dev in
+ lwt () = Unsafe.cursor_off dev in
+ let rec loop i = function
| [] ->
return ()
| line :: lines ->
- lwt () = Unsafe.send dev ("\x1b\x43\x1b\x73" ^ line) in
- let rec loop i = function
- | [] ->
- return ()
- | line :: lines ->
- lwt () = Unsafe.send dev (String.make 1 (char_of_int i) ^ line) in
- loop (i + 1) lines
- in
- loop 2 lines
+ lwt () = Unsafe.write_line dev i line in
+ loop (i + 1) lines
+ in
+ loop 1 lines
+ end
+
+ OL_method BacklightOn : unit = Unsafe.backlight_on
+ OL_method BacklightOff : unit = Unsafe.backlight_off
let make card path =
let dev = {
diff --git a/PC_Mainboard/lib_krobot/krobot.ml b/PC_Mainboard/lib_krobot/krobot.ml
index 7f3940d..cd5fbec 100644
--- a/PC_Mainboard/lib_krobot/krobot.ml
+++ b/PC_Mainboard/lib_krobot/krobot.ml
@@ -164,6 +164,8 @@ module LCD = Make_device(struct let name = "LCD" end)
OP_interface(LCD) "fr.krobot.Device.LCD"
OP_method SetLCD : string list -> unit
+OP_method BacklightOn : unit
+OP_method BacklightOff : unit
(* +-----------------------------------------------------------------+
| Range finders |
diff --git a/PC_Mainboard/lib_krobot/krobot.mli b/PC_Mainboard/lib_krobot/krobot.mli
index 3dc8a9a..47c2a13 100644
--- a/PC_Mainboard/lib_krobot/krobot.mli
+++ b/PC_Mainboard/lib_krobot/krobot.mli
@@ -35,6 +35,12 @@ val set_lcd : t -> string list -> unit Lwt.t
(** [set_lcd lines] set the lines displayed on the LCD. [lines] may
contains at most 4 lines, of maximum length 20. *)
+val backlight_on : t -> unit Lwt.t
+ (** Turn on the LCD backlight *)
+
+val backlight_off : t -> unit Lwt.t
+ (** Turn off the LCD backlight *)
+
(** {6 Compass} *)
val compass : t -> int React.signal
hooks/post-receive
--
krobot
|