User Tools

Site Tools


setting_up_the_slave_umds

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
setting_up_the_slave_umds [2016/12/21 17:35] – [Edit getData File] walkeradminsetting_up_the_slave_umds [2016/12/21 17:51] walkeradmin
Line 153: Line 153:
  
 ---- ----
-==== Raspi Config  ====+==== Edit launchUMD File  ==== 
 +\\  
 +The launchUMD file contains a link to the UMDisplay0x.py file 
 +\\  
 +<file> 
 +#!/bin/sh 
 +# launchUMD.sh 
 +# navigate to home directory, then to this directory then launch script 
 + 
 +cd / 
 +cd home/pi/Python 
 +sudo python UMDisplay01.py & 
 +cd / 
 +</file>   
 +\\  
 +This file needs to be edited so that the line <color blue>sudo python UMDisplay</color><color red>1</color><color blue>.py &</color> points to the correct UMD Device (so if this is your third UMD Device it needs to contain UMDisplay0<color red>3</color> 
 +\\  
 +    sudo nano launchUMD.sh 
 +\\  
 + 
 +---- 
 +==== Edit UMDsiplay0x File  ==== 
 +\\  
 +The UMDisplay0x file contains the code to write to the LCD. We do have to edit this file to tell it which of the two LCD lines to display from the my_data.txt file 
 +\\  
 +<file> 
 +# write line 1 and 2 to the LCD 
 +lcd_string(" " + line1,LCD_LINE_1) 
 +lcd_string(" " + line2,LCD_LINE_2) 
 +</file> 
 +\\  
 +<color red>Line1</color> refers to the line in the <color red>my_data.txt</color> file. So if this was UMD3, then you would want lines 5 and 6. so this would be: 
 +\\  
 +    lcd_string(" " + line5,LCD_LINE_1) 
 +    lcd_string(" " + line6,LCD_LINE_2) 
 +\\  
 +<color red>LCD_LINE_1</color> refers to the Line on the LCD (Line 1 is the top, line 2 is the bottom) 
 +\\  
 +\\  
 +Edit the UMDisplay0x.py file by using: 
 +\\  
 +    sudo nano /home/pi/Python/UMDisplay0x.py 
 +\\  
 + 
 +---- 
 +==== Test LCD Code ==== 
 +\\  
 +Assuming that you have connected the LCD to the RPi (via the ribbon cable and driver board) then you can test the code that runs the LCD, on the slave this file is the: 
 +\\  
 +    UMDisplay0x.py (where x is 2, 3, 4 4 etc.) 
 +\\  
 +This is a python script, you can run this script by entering at the command line: 
 +\\  
 +    ./UMDisplay02.py 
 +\\  
 +If you are lucky, you will see some text on the LCD, chances are however you will not. This is due to the Potentiometer settings on the driver board, you will need to change these to set the Backlight and LCD intensity. 
 +\\  
 +\\  
 +{{:rpi_umd_005.jpg?300|}} 
 +\\  
 +\\  
 +Adjusting these two potentiometers will allow you to balance the text and backlight intensity to get the brightness level you require. 
 +\\  
 +\\  
 + 
 +---- 
 +==== Making it Automatic ==== 
 +\\  
 +The last part is to automate the process of starting the UMD code. For this we need to add the launcher file to a system file on the RPi. 
 +\\  
 +\\  
 +Edit the file /etc/rc.local to automate this process. 
 +\\  
 +    sudo nano /etc/rc.local 
 +     
 +    add this line at the end: 
 +    sudo ./home/pi/Python/launchUMD.sh 
 +\\  
 +To test this, reboot and the LCD should start up automatically (the LCD won't clear on boot, but wait for the "Waiting for 5 Seconds for Network Start" message). 
 +\\  
 +\\  
 + 
setting_up_the_slave_umds.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1