Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serial communications
#1
Good Evening everyone,

I am hoping that someone will be able to help me kick start a little project I have been asked to create for a friend.
My challenge is to create an interface to control solenoid’s and send and receive commands from a weighing device.
My only issue is I haven’t done any coding/programming since the early 80’s on a BBCB micro...

I would like to use a PI3 as the interface as it has future expansion potential and it has Bluetooth built in and this is how I would like to communicate with the weighhead.

Here is a brief outline of how the script needs to go...

1) it will be triggered/started by a switch being made (through GPIO)
2) when the switch is made the script needs to send {RH} command over BT to the weighhead.
3) when the weighhead receives {RH} it will do it’s thing and reply over BT with [1] or [2] or [3] or a few possible error messages.
4) script needs to read the reply and change the state of GPIO pins dependant on reply ([1]=pin 1 high or [2]=pin 2 high or [3]=pin 3 high)
5) once pin state has been set, script needs to send {RD} over BT to the weighhead, this makes the weighhead record it’s data, it will then reply with some data (this is not relevant to the script however it does confirm that the data on the weighhead has been recorded.

This is just the basic script I need, there are delays and other GPIO pin changes that need to be implemented but that can come later, if anyone can help with the sending and receiving of the commands over BT I would be very grateful...

Thanks in advance

Tom.
Reply
#2
General python tutorial: https://docs.python.org/3/tutorial/
my favorite tutorial: https://www.python-course.eu/

1.) Using a push switch: https://raspberrypihq.com/use-a-push-but...y-pi-gpio/
2.) https://raspberrypi.stackexchange.com/qu...ommunicate
3.) see 2
4.) https://makezine.com/projects/tutorial-r...nd-python/
5.) see above
This will get you started
Reply
#3
Thank you for your reply, I will get reading and see what I can come up with.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 3,327 Aug-24-2023, 07:56 AM
Last Post: gowb0w

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020