Go to advanced search

by gryffin13
Sat May 25, 2019 3:32 am
Forum: Python
Topic: Help reading in serial strings into pi from arduino?
Replies: 6
Views: 949

Re: Help reading in serial strings into pi from arduino?

- instead of sensor1status = line[0] if sensor1status == "T": sensor1 = True elif sensor1status == "F": sensor1 = False you can write sensor1 = line[0] == 'T' which makes the code better readable. /quote] I spent a while looking at this trying to figure out how it did the same thing. I'm not great ...
by gryffin13
Fri May 24, 2019 8:30 pm
Forum: Python
Topic: Help reading in serial strings into pi from arduino?
Replies: 6
Views: 949

Re: Help reading in serial strings into pi from arduino?

A few remarks are possible: - in the function, the serial line is opened, but never closed. On the other side, as it is never known when the arduino is sending, the line should be kept open. - instead of sensor1status = line[0] if sensor1status == "T": sensor1 = True elif sensor1status == "F": sens...
by gryffin13
Fri May 24, 2019 8:24 pm
Forum: Python
Topic: Help reading in serial strings into pi from arduino?
Replies: 6
Views: 949

Re: Help reading in serial strings into pi from arduino?

scruss wrote:
Fri May 24, 2019 7:51 pm
You should also have a timeout in your serial open command. You program may try to wait forever without one.
Valid point. I've added that to my code.
by gryffin13
Fri May 24, 2019 3:33 am
Forum: Python
Topic: Help reading in serial strings into pi from arduino?
Replies: 6
Views: 949

Help reading in serial strings into pi from arduino?

I have an arduino that is sending a serial string to my pi based on the status of 4 different sensors. How I have it set up right now is that the arduino is sending a 4 character string based on which sensors are on. T for on, F for off. So it might send something like "FTFF". Then I have the pi rea...
by gryffin13
Thu May 09, 2019 12:19 am
Forum: Python
Topic: Interrupts not behaving as expected
Replies: 5
Views: 461

Re: Interrupts not behaving as expected

The reason I do not add the pull-downs is because the circuity I am using does not require it. What I would suggest you do is first make sure that your button code works. You can use the code I provided, just change the pull-down and pin numbers. If that works, then add the things that I left out, ...
by gryffin13
Tue May 07, 2019 3:00 am
Forum: Python
Topic: Interrupts not behaving as expected
Replies: 5
Views: 461

Re: Interrupts not behaving as expected

Ok, I will do that. Thank you for the help.
by gryffin13
Mon May 06, 2019 4:28 am
Forum: Python
Topic: Interrupts not behaving as expected
Replies: 5
Views: 461

Re: Interrupts not behaving as expected

Thanks for the input. Before you modified it did you notice the same behavior?

Is there a reason you removed the pull down resistor?
by gryffin13
Sun May 05, 2019 1:22 am
Forum: Python
Topic: Interrupts not behaving as expected
Replies: 5
Views: 461

Interrupts not behaving as expected

Hi, I'm building a project and trying to use interrupts and they are not behaving as expected. It seems like there is not many examples out there to go off of, so I've pieced it together the best I can. (I'm still learning both raspberry pi and python, so everything is pretty rudimentary for me). Wh...
by gryffin13
Sat Jun 03, 2017 3:07 am
Forum: Beginners
Topic: Code acts differently when I run from terminal vs on boot
Replies: 0
Views: 278

Code acts differently when I run from terminal vs on boot

First off, I'm a beginner, so don't assume that I know anything. I've cobbled this together from multiple resources, piggybacking off other people's code and using my knowledge from arduino stuff. Also I might have mulitple issues going on here, so I'm game to try multiple things. Thanks! I have a r...

Go to advanced search