[chronojump] New automatic firmware working using chronojump_mini
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] New automatic firmware working using chronojump_mini
- Date: Wed, 10 Sep 2014 13:21:51 +0000 (UTC)
commit 3720a0e2b6e43476f28ab3bba5ff085ee5cf1b7f
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Sep 10 15:20:55 2014 +0200
New automatic firmware working using chronojump_mini
src/Mini/chronojump_mini.cs | 5 +++++
src/chronopic.cs | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/src/Mini/chronojump_mini.cs b/src/Mini/chronojump_mini.cs
index 7a0e04c..eeb4ba8 100644
--- a/src/Mini/chronojump_mini.cs
+++ b/src/Mini/chronojump_mini.cs
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2005 Juan Gonzalez Gomez
+ * Copyright (C) 2014 Xavier de Blas <xaviblas gmail com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -163,6 +164,10 @@ class ChronoJumpMini {
Console.WriteLine(string.Format(Catalog.GetString("Platform state: {0}"), estado_plataforma));
+ Console.WriteLine("Automatic variables: ");
+ cp.Read_variables_automatic();
+
+
//-- Establecer el estado inicial del automata
if (estado_plataforma==Chronopic.Plataforma.ON)
estado_automata=Automata.ON;
diff --git a/src/chronopic.cs b/src/chronopic.cs
index db80ba8..04cf793 100644
--- a/src/chronopic.cs
+++ b/src/chronopic.cs
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2005 Juan Gonzalez Gomez
+ * Copyright (C) 2014 Xavier de Blas <xaviblas gmail com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -148,6 +149,47 @@ Console.Write("4");
return true;
}
+
+
+ //for "automatic" firmware 1.1: debounce can change, get version, port scanning
+ public void Read_variables_automatic()
+ {
+ Console.Write(" ReadVarAutoStart ");
+
+ if (sp == null)
+ sp.Open();
+
+ Console.Write(" ReadVarAutoOpened ");
+
+ //byte[] answer = new byte[1];
+
+ Console.WriteLine("---------------------------");
+
+ sp.Write("V");
+ Console.WriteLine("Version: " + sp.ReadLine());
+
+ sp.Write("J");
+ Console.WriteLine("Port scanning (should return 'J'): " + sp.ReadLine());
+
+ sp.Write("a");
+ Console.WriteLine("debounce time (need to *10): " + sp.ReadLine());
+
+ Console.WriteLine("Changing to 10 ms");
+ sp.Write("b\x01");
+
+ sp.Write("a");
+ Console.WriteLine("debounce time (need to *10): " + sp.ReadLine());
+
+ Console.WriteLine("Changing to 50 ms");
+ sp.Write("b\x05");
+
+ sp.Write("a");
+ Console.WriteLine("debounce time (need to *10): " + sp.ReadLine());
+
+ Console.WriteLine("---------------------------");
+
+ Console.Write(" ReadVarAutoEnd ");
+ }
//----------------------------------------
//-- Obtener el estado de la plataforma
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]