Go to advanced search

by hippy
Tue Dec 10, 2019 12:20 am
Forum: Graphics programming
Topic: 3,5" LCD Display NOT used as a desktop...
Replies: 20
Views: 2010

Re: 3,5" LCD Display NOT used as a desktop...

... The OP doesn't want to run any of those scripts. Those scripts make the LCD the default 'Pi Desktop Screen', or whatever one wishes to call it; 'primary ... output, but wants to separately control the added LCD direct from a Python ( or other ) program. That's easily done by using RPi.GPIO and ...
by hippy
Mon Dec 09, 2019 4:55 pm
Forum: Graphics programming
Topic: 3,5" LCD Display NOT used as a desktop...
Replies: 20
Views: 2010

Re: 3,5" LCD Display NOT used as a desktop...

has someone managed to use the 3,5" LCD Display NOT as a desktop, but as a side display programmed with e.g. Python? Yes, and I have a strong sense of Deja Vu that I've answered this question before, even provided ...
by rin67630
Mon Dec 09, 2019 10:48 am
Forum: Graphics programming
Topic: 3,5" LCD Display NOT used as a desktop...
Replies: 20
Views: 2010

3,5" LCD Display NOT used as a desktop...

Hi,
has someone managed to use the 3,5" LCD Display NOT as a desktop, but as a side display programmed with e.g. Python?
I'd like to find some code to start with...
by joan
Sun Dec 01, 2019 12:15 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C recognized but no output
Replies: 3
Views: 283

Re: I2C recognized but no output

Try http://abyz.me.uk/rpi/pigpio/examples.h ... i2c_lcd_py

It needs the pigpio daemon running (sudo pigpiod).
by pcmanbob
Fri Nov 29, 2019 10:52 am
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

Your code looks good congratulations on getting it working.

one point you don't use

Code: Select all

os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
to enable 1-wire interface any more , you just need to run raspi-config and go to interfaces and enable 1-wire from there .
by rpdom
Fri Nov 29, 2019 6:23 am
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

Awesome! Got the code written and implemented and it works perfectly. Congratulations! That is very similar to a project I started some years back, when we only had one spider. We were going away for a few days and wanted to make sure the spider (Nightshade, in my user icon) kept warm enough withou...
by kintan
Fri Nov 29, 2019 12:16 am
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

... 2 channels being used) which is wired into a power strip. It checks the temperature of a DS18B20 temp probe, displays the temperature on a 20x4 LCD screen and turns on or off channel 1 of the relay depending on the temperature. It also turns on or off a light on relay channel 2 depending on ...
by pcmanbob
Thu Nov 28, 2019 6:54 pm
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

All the print statements are just there for user interaction/debugging and can be removed.
by kintan
Thu Nov 28, 2019 6:38 pm
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

Looking at the code above, the print function will print the hours, minutes, seconds right? Is this necessary for the loop or can I omit that?
by pcmanbob
Thu Nov 28, 2019 4:03 pm
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

... drop that as well if you don't need that. you would need to add the contents of the while true loop to your existing while true loop . #!/usr/bin/python import time from random import randint import RPi.GPIO as GPIO GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) #Use BCM GPIO numbers #Define GPIO ...
by kintan
Thu Nov 28, 2019 3:20 pm
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

... like it to be in the same program loop. Basically I want to turn a light on at 8am and off at 8pm. I have this line to display the time on the LCD, but cannot figure out how to compare the time to a variable and activate a relay for it. lcd.message = time.strftime("%H:%M")
by kintan
Thu Nov 28, 2019 2:11 pm
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

Thank you for the reply. I actually solved the issue right after posting this :D I did not think about only calling the temperature once though, so thank you for that!
by pcmanbob
Thu Nov 28, 2019 12:25 pm
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Re: Python and a DS18B20, 5v relay module, Adafruit I2C LCD

... you are not waiting for the sensor to be accessed each time you want to test the if statement. you can also use the temperature variable in your LCD line by simple add the str() function to it to convert the float value in to a string. this is the only bit of your code you need to change. while ...
by kintan
Wed Nov 27, 2019 11:27 pm
Forum: Python
Topic: Python and a DS18B20, 5v relay module, Adafruit I2C LCD
Replies: 9
Views: 491

Python and a DS18B20, 5v relay module, Adafruit I2C LCD

... via a 5v relay and a DS18B20. I have that code fine and working. What I want to do now is to also display the temperature on a 20x4 Adafruit LCD with an I2C backpack. My issue is, to display the temperature it needs to be a string, but to do the calculations to control the relay it is in ...
by pcmanbob
Fri Nov 15, 2019 10:22 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

... I2C interface was being used it still wouldn't have worked. The driver I suggested RPLCD again supports both I2C and direct gpio control and also python 2 & 3.
by pcmanbob
Mon Nov 11, 2019 4:49 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

... on installing and setting up . I would suggest you start over with a fresh install of raspbian stretch or preferably buster, RPLCD will work with python 2 & 3.
by DougieLawson
Sun Nov 10, 2019 8:58 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

You may need to use

Code: Select all

#!/usr/bin/python
since it appears Adafruit aren't living in the same decade as the rest of us. It's a special comment known as a shebang line. https://en.wikipedia.org/wiki/Shebang_(Unix)
by rpdom
Sun Nov 10, 2019 8:45 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

... is commented out with the # No, it isn't. The #! syntax on the first line of a script has a special meaning to the Linux command line (not the Python interpreter shell where you appear to be running it from.) But as previously mentioned, that code doesn't appear to be support under Python3 ...
by pcmanbob
Sun Nov 10, 2019 6:42 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

... line in the terminal window. The import bit is only ever run in a python program, never at the command line. So try this to test just your LCD, its based on the code in the tutorial so it should work with your LCD as connected. import ...
by PhilR100742
Sun Nov 10, 2019 5:20 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

2. After installation of LCD library now the Adafruit_python_CharLCD can be used from any python script by using the following line import Adafruit_CharLCD as LCD​ ...
by PhilR100742
Sun Nov 10, 2019 4:46 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

Ok, here we go. I ran the install command in Terminal, the install line returned this:- pi@raspberrypi:~/Adafruit_Python_CharLCD $ sudo python setup.py install running install running bdist_egg running egg_info creating Adafruit_CharLCD.egg-info writing requirements to Adafruit_CharLCD.egg-info/requires.txt ...
by PhilR100742
Sun Nov 10, 2019 4:25 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

Fine, thank you again. I presume that as the modules install in the Home/Pi directory things are correct. The other thing is that the lines of code calling for the modules may not have the same module names; such as the Adafruit_Python_CharLCD module. The code calls for Adafruit_CharLCD. Should I re...
by pcmanbob
Sun Nov 10, 2019 1:03 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

I forgot to say that the LCD module is installed as: Adafruit_python_CharLCD, not as Adafruit_CharLCD. This probably doesn't help. However, I will go through the install ...
by PhilR100742
Sun Nov 10, 2019 12:09 pm
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

I forgot to say that the LCD module is installed as: Adafruit_python_CharLCD, not as Adafruit_CharLCD. This probably doesn't help.

However, I will go through the install again.
by pcmanbob
Sun Nov 10, 2019 11:09 am
Forum: General discussion
Topic: MCP4725 DAC with LCD issues
Replies: 44
Views: 3126

Re: MCP4725 DAC with LCD issues

... post the error " ModuleNotFoundError: No module named 'Adafruit_CharLCD' " suggests you have not installed the module so I would suggest trying ... cd Adafruit_Python_CharLCD sudo python setup.py install 2. After installation of LCD library now the Adafruit_python_CharLCD ...

Go to advanced search