Project: Feeder System
Palli Steina
Posts: 6
Hello everyone.
I'm working on a project that sounds simple, but I feel like I'm doing a good job of complicating it.
We are making a feeder system that is suppose to feed fish at 100m depth at regular intervals. The plan is to have a BS2 control a solenoid valve and open it for a "X" period of time, close and wait for "Y" period of time, loop. The BS2 will be connected to a PC via RS232.
The problem:
I want to be able to change "X" and "Y" through the RS232, but I'm having hard time figuring out the best way. I dont want the BS2 to be dependant on the PC, so when the data is sent, it should feed at that interval.
How would I "listen" for a serial string sent from a PC while still looping the feeder?
Regards,
Palli
I'm working on a project that sounds simple, but I feel like I'm doing a good job of complicating it.
We are making a feeder system that is suppose to feed fish at 100m depth at regular intervals. The plan is to have a BS2 control a solenoid valve and open it for a "X" period of time, close and wait for "Y" period of time, loop. The BS2 will be connected to a PC via RS232.
The problem:
I want to be able to change "X" and "Y" through the RS232, but I'm having hard time figuring out the best way. I dont want the BS2 to be dependant on the PC, so when the data is sent, it should feed at that interval.
How would I "listen" for a serial string sent from a PC while still looping the feeder?
Regards,
Palli
Comments
Typing in an exlamation signals you want to update and the debug statements prompt you to enter the new values .
Jeff T.
Its good to have someone to point your way when you have been running in circles. This had crossed my mind, but the code I had already written was in the way.
I'll finish this up and post my code when its done.
Regards,
Palli
[code]
' {$STAMP BS2}
' {$PBASIC 2.5}
' Fastar
relay PIN 0 ' Relay
timi CON 60000 ' 1 min
' Breytur
bid VAR Word ' Lengd p
I would change the Debugs to SEROUT too. The previous was only pseudo type code for example which you seem to have adapted quite well.
Only other thing I might do is run at 4800 baud or less , speed is not that critical , but if it's working leave it as it is
Jeff T.