Raspberry Pi anyone?
Moderator: RichardW
- CitroJim
- A very naughty boy
- Posts: 49658
- Joined: 30 Apr 2005, 23:33
- Location: Paggers
- My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
- x 6203
- Contact:
Re: Raspberry Pi anyone?
Splendid stuff Xac..
You know, we'll soon have you extolling the virtues of the vi editor at this rate
You know, we'll soon have you extolling the virtues of the vi editor at this rate
Jim
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
- Xaccers
- Posts: 7654
- Joined: 07 Feb 2007, 23:46
- Location: Milling around Milton Keynes
- My Cars:
- x 184
Re: Raspberry Pi anyone?
I use nano
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
Re: Raspberry Pi anyone?
I was about to say the same... I was sysadmin of many Linux servers for years and used, yep, nano. (or pico which was identical) Never felt a need to learn vi or emacs even though I was doing quite a lot of shell scripting and of course conf file editing...all my servers had the default editor changed from vi to nano.Xac wrote:I use nano
Scrolling, insert typing, cut and paste, search, what else do you need ? I'm sure I'll loose a lot of Linux geek cred for admitting to never using vi or emacs but who cares...
Simon
1997 Xantia S1 3.0 V6 Auto Exclusive in Silex Grey
2016 Nissan Leaf Tekna 30kWh in White
2011 Peugeot Ion Full Electric in Silver
1977 G Special 1129cc LHD
1978 CX 2400
1997 Xantia S1 2.0i Auto VSX
1998 Xantia S2 3.0 V6 Auto Exclusive
1997 Xantia S1 3.0 V6 Auto Exclusive in Silex Grey
2016 Nissan Leaf Tekna 30kWh in White
2011 Peugeot Ion Full Electric in Silver
1977 G Special 1129cc LHD
1978 CX 2400
1997 Xantia S1 2.0i Auto VSX
1998 Xantia S2 3.0 V6 Auto Exclusive
- Xaccers
- Posts: 7654
- Joined: 07 Feb 2007, 23:46
- Location: Milling around Milton Keynes
- My Cars:
- x 184
Re: Raspberry Pi anyone?
I vaguely remember vi from my days at uni, where I lost my network access for 2 weeks for mudding.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
- Ben82
- Posts: 1086
- Joined: 03 Dec 2012, 07:47
- Location: Sköllersta/Örebro, Sweden
- My Cars: C5 V6 2004
- x 7
Re: Raspberry Pi anyone?
I actually switched from nano to vim about a year or so ago, for one main thing, syntax highlighting (yes nano has some, but not as extensive as vim)
I only know a handful of vim commands, but its enough to get me by
I only know a handful of vim commands, but its enough to get me by
2004 Citroen C5 3L V6 Auto
Brit living in Sweden with an imported from Germany French Car!
Brit living in Sweden with an imported from Germany French Car!
- CitroJim
- A very naughty boy
- Posts: 49658
- Joined: 30 Apr 2005, 23:33
- Location: Paggers
- My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
- x 6203
- Contact:
Re: Raspberry Pi anyone?
That's a girl's editorXac wrote:I use nano
I jest. I only use vi because some of the systems I work on have nothing else so familiarity is essential and regular use of vi is essential so as not to inadvertently make a dog's breakfast of something critical.
I even have gvim (a port of vi to Windows) installed on some of my Windows machines... Just for editing stuff destined for the Unix world as Notepad can occasionally have undesirable effects when editing some Unix shell scripts...
I like nano. It's good.
Never ever used emacs...
Jim
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
- Xaccers
- Posts: 7654
- Joined: 07 Feb 2007, 23:46
- Location: Milling around Milton Keynes
- My Cars:
- x 184
Re: Raspberry Pi anyone?
Jim can you cast your eyes over this code
I should be able to add
and have it display The rain in spain on the LCD right?
print(message) would do that.
Code: Select all
from i2clibraries import i2c_lcd
from time import *
# Configuration parameters
# I2C Address, Port, Enable pin, RW pin, RS pin, Data 4 pin, Data 5 pin, Data 6 pin, Data 7 pin, Backlight pin (optional)
lcd = i2c_lcd.i2c_lcd(0x27,0, 2, 1, 0, 4, 5, 6, 7, 3)
# If you want to disable the cursor, uncomment the following line
# lcd.command(lcd.CMD_Display_Control | lcd.OPT_Enable_Display)
lcd.backLightOn()
lcd.writeString("Python I2C LCD")
lcd.setPosition(2, 3)
lcd.writeString("For the Pi")
Code: Select all
message = The rain in spain
lcd.writeString(message)
print(message) would do that.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
- CitroJim
- A very naughty boy
- Posts: 49658
- Joined: 30 Apr 2005, 23:33
- Location: Paggers
- My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
- x 6203
- Contact:
Re: Raspberry Pi anyone?
I would tend to agree with that Xac. I looked up the declaration and use of variables in Python and that seems to be good.Xac wrote: I should be able to addand have it display The rain in spain on the LCD right?Code: Select all
message = The rain in spain lcd.writeString(message)
print(message) would do that.
Only one way to find out
Jim
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
- Xaccers
- Posts: 7654
- Joined: 07 Feb 2007, 23:46
- Location: Milling around Milton Keynes
- My Cars:
- x 184
Re: Raspberry Pi anyone?
I tried last night and it just displayed: message
Will have to try tonight.
Will have to try tonight.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
- CitroJim
- A very naughty boy
- Posts: 49658
- Joined: 30 Apr 2005, 23:33
- Location: Paggers
- My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
- x 6203
- Contact:
Re: Raspberry Pi anyone?
Ummm,
The library that has that function is not following rules. have you looked at the code within the library?
The library that has that function is not following rules. have you looked at the code within the library?
Jim
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
- spider
- Posts: 3949
- Joined: 05 Jan 2010, 14:28
- Location: Derby.
- My Cars: Soon, I hope...
- x 77
- Contact:
Re: Raspberry Pi anyone?
Is this the topic for assembly language ?
* looks around *
No, goes back to his assembler
* looks around *
No, goes back to his assembler
Andy.
91 205D-Turbo, gone but still missed
02 106D, TUD5B, gone but not really missed apart from the MPG
91 205D-Turbo, gone but still missed
02 106D, TUD5B, gone but not really missed apart from the MPG
- CitroJim
- A very naughty boy
- Posts: 49658
- Joined: 30 Apr 2005, 23:33
- Location: Paggers
- My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
- x 6203
- Contact:
Re: Raspberry Pi anyone?
By all means Andy... I used to back in Z80/8080 and CP/M days...spider wrote:Is this the topic for assembly language ?
Jim
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
- Xaccers
- Posts: 7654
- Joined: 07 Feb 2007, 23:46
- Location: Milling around Milton Keynes
- My Cars:
- x 184
Re: Raspberry Pi anyone?
Eureka I've done it.
Used a bash script to get the temperature (temp=xx.x'C).
I call that within the python script and chop it down to remove the temp=
Used a bash script to get the temperature (temp=xx.x'C).
I call that within the python script and chop it down to remove the temp=
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
- CitroJim
- A very naughty boy
- Posts: 49658
- Joined: 30 Apr 2005, 23:33
- Location: Paggers
- My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
- x 6203
- Contact:
Re: Raspberry Pi anyone?
Let's see your code then XacXac wrote:Eureka I've done it.
Used a bash script to get the temperature (temp=xx.x'C).
I call that within the python script and chop it down to remove the temp=
Jim
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
- Xaccers
- Posts: 7654
- Joined: 07 Feb 2007, 23:46
- Location: Milling around Milton Keynes
- My Cars:
- x 184
Re: Raspberry Pi anyone?
The bash scriptCitroJim wrote:Let's see your code then XacXac wrote:Eureka I've done it.
Used a bash script to get the temperature (temp=xx.x'C).
I call that within the python script and chop it down to remove the temp=
Code: Select all
#!/bin/bash
#get system temperarure and save as 'sysTemp'
/opt/vc/bin/vcgencmd measure_temp > sysTemp
# this creates a file called sysTemp in current directory
Code: Select all
import sys, subprocess
# appends to PYTHONPATH the location of the example codes
sys.path.append("/home/pi/quick2wire-python-api/")
from i2clibraries import i2c_lcd
from time import *
subprocess.call("/home/pi/temp.sh")
# Configuration parameters
# I2C Address, Port, Enable pin, RW pin, RS pin, Data 4 pin, Data 5 pin, Data 6 pin, Data 7 pin, Backlight pin (optional)
lcd = i2c_lcd.i2c_lcd(0x20,1, 2, 1, 0, 4, 5, 6, 7, 3)
# If you want to disable the cursor, uncomment the following line
lcd.command(lcd.CMD_Display_Control | lcd.OPT_Enable_Display)
lcd.backLightOn()
def line1():
lcd.writeString("Current Temp:")
def line2():
fo = open("sysTemp")
str = fo.read()
fo.close()
lcd.writeString(str.strip().strip("temp="))
lcd.clear()
line1()
lcd.setPosition(2, 0)
line2()
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)
DIY sphere tool