Editing SmartTerminal for Controlino

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
= What =
 
= What =
This is part of the [[Instrumentino/Smart Terminal Challenge]].  In this part I am going to try to adapt the SmartTerminal ( PC/Python ) [[Python Smart Terminal]] to the ( microcontroller ) Controlino program [[Controlino Notes]]. The code for this extension is in '''ext_process_co.py'''.  This documentation is written as if you were writing '''ext_process_co.py'''
+
This is part of the [[Instrumentino/Smart Terminal Challenge]].  In this part I am going to try to adapt the SmartTerminal ( PC/Python ) [[Python Smart Terminal]] to the ( microcontroller ) Controlino program [[Controlino Notes]].
starting with ''ext_process_gh.py''' as a sort of template ( copy and modify ).  '''And as I try to bring this up to date I see that a lot has changed and this needs a top to bottom rewrite.  Email me if you need this information.'''
 
  
 
= First Connection =
 
= First Connection =
For your first connection we will just try to establish a basic connection between the two programs ( Python and Arduino ), typically this involves matching the communications parameters.  Baud rate is, perhaps, the most basic.  At this point we will not write any code, but just adjust the parameter program ( remember all this work is already done in the code at git hub, this is a recreation story ).
+
Here we will just try to establish a basic connection between the two programs, typically this involves matching the communications parameters.  Baud rate is, perhaps, the most basic.
  
 
Steps:
 
Steps:
* go to Arduino Controlino program find baudrate #define SERIAL0_BAUD 19200 
+
* go to Controlino program find baudrate #define SERIAL0_BAUD 115200
 
* go to SmartTerminal parameters.py and define a new mode Controlino: ( this code is near the top of parameters.py and you will see a bunch of modes defined there, likely with several comented out, remember the lats value set is the one that wins.  Your code should then look something like:
 
* go to SmartTerminal parameters.py and define a new mode Controlino: ( this code is near the top of parameters.py and you will see a bunch of modes defined there, likely with several comented out, remember the lats value set is the one that wins.  Your code should then look something like:
  
 
<pre>
 
<pre>
     # self.mode              = "GreenHouse"  # add sensor processing, monitoring and logging for greenhouse sensors
+
     self.mode              = "GreenHouse"  # add sensor processing, monitoring and logging for greenhouse sensors
 
     # self.mode              = "IR"
 
     # self.mode              = "IR"
 
     # self.mode              = "MotorDriver"  # special buttons, send arrays for motor controller arduino
 
     # self.mode              = "MotorDriver"  # special buttons, send arrays for motor controller arduino
Line 17: Line 16:
 
    
 
    
 
</pre>  
 
</pre>  
** defining a mode this way using a subroutine ... is not really the way I do it when this documentation was written .. it is badly out of date.  is not really needed but this way it is easy to turn on and off the Controlino settings.
+
** defining a mode is not really needed but this way it is easy to turn on and off the Controlino settings.
 
** find        self.baudrate and add at end of baud rate section         
 
** find        self.baudrate and add at end of baud rate section         
 
<pre>
 
<pre>
 
     if self.mode == "Controlino":  
 
     if self.mode == "Controlino":  
         self.baudrate          =      19200   # match to the Arduino program
+
         self.baudrate          =      19200
 
</pre>
 
</pre>
  
Line 93: Line 92:
  
 
= Automation =
 
= Automation =
== Make '''ext_process_co.py''' ==
+
== Make co_processing ==
Here we will automate the above.  This is done by creating a class called ControlinoProcessing in ext_process_co.py and inserting/editing the code.  To make this easier we will copy another processing unit of code.  Copy ext_process_gh.py and save as ext_process_co.py
+
Here we will automate the above.  This is done by creating a class called ControlinoProcessing in co_processing.py and inserting/editing the code.  To make this easier we will copy another processing unit of code.  Copy gh_processing.py and save as co_processing.py  
 +
 
  
 
== Edit Parameters ==
 
== Edit Parameters ==
Line 173: Line 173:
  
 
I am going to give directions using the same style of Tkinker coding that I have used, but other style can also work, you just have to make sure the widgets link to the correct code.
 
I am going to give directions using the same style of Tkinker coding that I have used, but other style can also work, you just have to make sure the widgets link to the correct code.
 
 
[[Category:SmartTerminal]] [[Category:Arduino/RaspberryPi]] [[Category:SmartTerminal]]
 

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)