Hardware Reference
In-Depth Information
pygame.display.update()
except:
pass
if event.key == K_HASH :
#Save folder to Flickr / Facebook
print “sending folder to Flickr”
subprocess.check_output(“python ;
folders2flickr/uploadr.py”,shell=True)
print “done”
if event.key == K_HOME : # save a picture
print “save sketch to file”
if picture == 1 : # first time to save this session
fileName = raw_input(“Enter file name ;
for this session “)
try:
pygame.image.save(screen,;
'roto-sketch/'+fileName+str(picture)+'.png')
except:
os.system('mkdir roto-sketch')
pygame.image.save(screen,;
'roto-sketch/'+fileName+str(picture)+'.png')
print “saving sketch as “,;
'roto-sketch/'+fileName+str(picture)+'.png'
picture +=1;
if __name__ == '__main__':
main()
It is possible that you could get an error on the line
from smbus import SMBus
If you do then you will need to install smbus , which is easily done by typing
apt-get install python-smbus
on a command line.
he code might look complex, but it consists of a few simple functions - some of which you
have already looked at when you considered the rotary controls. It starts of in the normal
fashion by importing the modules it will need, and setting up some global variables. hen it
Search WWH ::




Custom Search