Go to advanced search

by mikefkp
Wed Jan 21, 2015 11:04 pm
Forum: Python
Topic: NOOB needs help with push button code.
Replies: 4
Views: 965

Re: NOOB needs help with push button code.

In Python the level of indentation determines to which block of code a line belongs to. So your call to 'main' at the end of the code is actually part of the definition of function 'main'. The function is never called... Removing the spaces in front of the all to main should fix this. BTW: I would ...
by mikefkp
Tue Jan 20, 2015 5:53 pm
Forum: Python
Topic: NOOB needs help with push button code.
Replies: 4
Views: 965

Re: NOOB needs help with push button code.

Made a try based on the link on previous post. Is something missing? I don't really get it to work, when i load it nothing happens. Is there a friendly soul out there that can help me out? #!/usr/bin/python # Script for NesPi # import import RPi.GPIO as GPIO import time import os import uinput PRESS...
by mikefkp
Thu Jan 15, 2015 7:28 pm
Forum: Other languages
Topic: Swedish
Replies: 30
Views: 34367

Re: Swedish

Hej.

Finns det någon svensk här som är grym och hjälpsam på python?
Skulle behöva lite hjälp. :D
by mikefkp
Thu Jan 15, 2015 7:19 pm
Forum: Python
Topic: NOOB needs help with push button code.
Replies: 4
Views: 965

NOOB needs help with push button code.

Hi, Just got my Pi B+ and i got a question. I want to use a simple momentary push-button for two different commands: 1. A short press to send "ESC"-key to active program and 2. A long press to run command: "sudo shutdown -h now" I was thinking of using any gpio with internal pull-up resistor Is it e...

Go to advanced search