Go to advanced search

by cae2100
Mon Mar 25, 2013 8:57 am
Forum: Python
Topic: Connecting two GPIO pins together?
Replies: 5
Views: 3944

Re: Connecting two GPIO pins together?

another solution could be to do it in software instead just using one pin for output, then switch it to input and read the state, then set it back as output again. when you switch it to input, it stays at whatever state it was at before switching.
by cae2100
Sun Mar 24, 2013 9:46 pm
Forum: Python
Topic: cannot load auth module
Replies: 10
Views: 2366

Re: cannot load auth module

I'd change the name of auth.py file to something else, like chatauth.py and call that instead since it's supposed to be included, maybe it's trying to load something else and it's countering with another file. Another thing I'd check is auth.py's spelling, and caps, if it has any caps in it, it has ...
by cae2100
Fri Mar 22, 2013 7:28 pm
Forum: Python
Topic: Printing to file from arduino serial output
Replies: 5
Views: 1325

Re: Printing to file from arduino serial output

most of the time, arduino is attached to /dev/ttyACM0
by cae2100
Thu Mar 21, 2013 7:32 pm
Forum: Python
Topic: Printing to file from arduino serial output
Replies: 5
Views: 1325

Re: Printing to file from arduino serial output

and here's a simple program to get user input and outputs it to a file

Code: Select all

fob = open('output.txt', 'w')
blahvar = raw_input()
print fob.write(blahvar)
fob.close
by cae2100
Thu Mar 21, 2013 8:54 am
Forum: Python
Topic: UART
Replies: 30
Views: 9003

Re: UART

try this instead:

Code: Select all

import serial
usbport = '/dev/ttyAMA0'
ser = serial.Serial(usbport, 9600, timeout=1)
ser.writeline("Raspberry pi")
while 1:
    x = ser.readline()
    print x
    
ser.close()
by cae2100
Wed Mar 20, 2013 5:51 pm
Forum: Python
Topic: cannot load auth module
Replies: 10
Views: 2366

Re: cannot load auth module

I meant having the auth.py file in the same folder as your program, unless you installed it using "sudo python setup.py install" command.
by cae2100
Wed Mar 20, 2013 11:43 am
Forum: Python
Topic: UART
Replies: 30
Views: 9003

Re: UART

Also, from the looks of it, you havnt done much in the way of programming in python, I would check out some tutorials in python first bc your code itself. On youtube, look up thenewboston and watch his python tutorials, they're pretty good and easy to catch onto. Even if set to the right location fo...
by cae2100
Wed Mar 20, 2013 9:44 am
Forum: Python
Topic: UART
Replies: 30
Views: 9003

Re: UART

after thinking about it, it sounds like they're trying to use the rpi as a serial terminal.
by cae2100
Wed Mar 20, 2013 8:49 am
Forum: Python
Topic: cannot load auth module
Replies: 10
Views: 2366

Re: cannot load auth module

try cd'ing into the folder with the program/library and running the program from there, might help then. also make sure the library file is in the same folder as the main program.
by cae2100
Wed Mar 20, 2013 8:46 am
Forum: Python
Topic: Answer per SSH in python
Replies: 1
Views: 528

Re: Answer per SSH in python

first off, you arent looking for help in python, you're trying to get help for c#, completely different languages, and if you are trying to do it in python, which doesnt look like it, look here.
http://stackoverflow.com/questions/3586 ... ith-python
by cae2100
Wed Mar 20, 2013 8:37 am
Forum: Python
Topic: UART
Replies: 30
Views: 9003

Re: UART

it is just as I had posted above, use /dev/ttyAMA0 just make sure you use some type of level converter chip or resistor voltage divider so you dont burn up your raspberry pi. or if your using a usb serial port device instead of hooking it directly to the rpi's pins, use /dev/ttyUSB0 or /dev/ttyUSB1 ...
by cae2100
Tue Mar 05, 2013 2:42 am
Forum: Python
Topic: Running python script from SSH
Replies: 4
Views: 12898

Re: Running python script from SSH

programs that use GUIs cant be started from SSH terminal, either start it on the raspberry pi or through vnc server
by cae2100
Fri Mar 01, 2013 8:52 am
Forum: Python
Topic: Using mic to light up diode -> newbie
Replies: 1
Views: 1430

Re: Using mic to light up diode -> newbie

well, the easiest way is to just use a mic element and comparator to tell when a loud sound, like a clap is detected and it'd send a pulse out, and into a pin on the raspberry pi, just make sure you use a voltage divider so it doesnt go over 3.3v, but have a python program detect it using input(), a...
by cae2100
Mon Feb 25, 2013 12:10 am
Forum: Python
Topic: Python .py file blank after reboot
Replies: 2
Views: 758

Re: Python .py file blank after reboot

only things I can think of is to check the tab on the side of the SD card to make sure the write protection isnt turned on, and check your power supply, maybe it isnt writing the data or it's getting corrupted as it's being run.
by cae2100
Sun Feb 24, 2013 7:24 pm
Forum: Python
Topic: object has no attribute 'setmode'
Replies: 9
Views: 10303

Re: object has no attribute 'setmode'

try adding "GPIO.setmode(BCM)" or "GPIO.setmode(board)" without quotes towards the top of the code, before setting up the pin's as input/outputs. the pins change depending on the mode, so make sure you have the one you need. I have a short tutorial here: http://cae2100.wordpress.com/2013/01/10/short...
by cae2100
Sat Feb 23, 2013 7:18 pm
Forum: Python
Topic: Problem reading from serial with Python script
Replies: 12
Views: 36373

Re: Problem reading from serial with Python script

try to use the code tags, it makes it alot easier to diagnose problems, also, change serial.readline() to serial.read() instead, may do what you want. import serial ser=serial.Serial('/dev/USB0', 9600, timeout=1) ser.write('1') #(echo '1' on terminal screen) # When arduino receives a single characte...
by cae2100
Sat Feb 23, 2013 7:15 pm
Forum: Python
Topic: RX TX with python
Replies: 2
Views: 2087

Re: RX TX with python

check out pyserial, it'll explain everything you need. second, we're here to help, not do everything for you, try to post code that you designed or found and we'll help fix the issues with it.
by cae2100
Wed Feb 20, 2013 3:12 am
Forum: Python
Topic: IndentationError
Replies: 6
Views: 4231

Re: IndentationError

the problem is the indentation, just use 4 spaces instead of tab key unless you have your editor set up for 4 spaces. Mybutton routine only has 3 spaces in front of it, here's the fixed example. #!/usr/bin/python import time import RPi.GPIO as GPIO GPIO.setup(11, GPIO.IN) while True: mybutton = GPIO...
by cae2100
Sat Feb 16, 2013 1:15 am
Forum: Python
Topic: Debugging
Replies: 4
Views: 911

Re: Debugging

try checking out the adafruit webIDE that they have, it does exactly like what your talking about.
by cae2100
Sat Feb 16, 2013 1:11 am
Forum: Python
Topic: Running Python via VNC
Replies: 4
Views: 4264

Re: Running Python via VNC

I didnt mean running the vnc server as root, but just using sudo to elevate python to root. like sudo python program.py whenever youre using the terminal in vnc.
by cae2100
Wed Feb 13, 2013 8:38 am
Forum: Python
Topic: Making the serial input buffer larger
Replies: 5
Views: 3938

Re: Making the serial input buffer larger

do you mind posting the full code for your program? it may help. also I know a little about errors that would cause trouble like your having, with buffer overruns, and try to flush the serial buffer after each read to keep it from overflowing the buffers. you can also try to set up a really small ti...
by cae2100
Mon Feb 11, 2013 4:04 pm
Forum: Python
Topic: Make controle script.
Replies: 6
Views: 941

Re: Make controle script.

just the word end, I use it as kinda a stopper for my projects. here's an example of what I mean, this is for auto searching and connecting to a serial port so it works on any system. import serial locations=['/dev/ttyACM0', '/dev/ttyACM1','/dev/ttyACM2', '/dev/ttyACM3','/dev/ttyACM4', '/dev/ttyACM5...
by cae2100
Mon Feb 11, 2013 11:20 am
Forum: Python
Topic: Make controle script.
Replies: 6
Views: 941

Re: Make controle script.

no working example, I was just giving a concept. you have a list of all addresses used by the i2c, and what the code does is search through them using a for loop to loop through all of the combinations, and if it finds one, you can assign a varable to 1 or something like that to tell that the locati...
by cae2100
Mon Feb 11, 2013 5:46 am
Forum: Python
Topic: why does python-pip require an older version of python?
Replies: 5
Views: 30978

Re: why does python-pip require an older version of python?

most plugins arent developed by python developers, rather third party developers, so no, they wont be updated with new python versions. in all honesty, I dont really see any difference between using 2.6 and 2.7 other than a few bug fixes, and even at that, you never actually see them anyhow.

Go to advanced search