Author Topic: Can you update a TouchScreen variable by reading serial data?  (Read 1408 times)

HAWanabee

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Not sure this should go here so forgive me. I'm want to update the temperature on a touchscreen. (with a homemade serial thermostat I'm making)  Can this be done with the generic serial driver within a script?  For example I just want to be able to parse a serial line and update every 30 seconds or so. Are there any code snippets available? My eyes are bleary from searching!
Also, are there any examples of what a complete simple driver looks like? (Code that is if I decide to write a driver down the road) Thanks!!

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Can you update a TouchScreen variable by reading serial data?
« Reply #1 on: March 03, 2011, 09:01:11 am »
Yes you should be able to do this.

Add a new rule for the Serial driver's received data event and then write a script to parse the incoming data.

You can then set a global variable driver property to any value you want. You should also add the variable name and a default value to the global variable settings to ensure it always exists.

You would then bind your touch screen control to that global variable.

There are a couple examples in the Generic Serial Driver documentation but they aren't exactly the same as what you are doing.
John Hughes
Codecore Technologies

HAWanabee2

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Can you update a TouchScreen variable by reading serial data?
« Reply #2 on: March 04, 2011, 03:27:51 am »
Thanks John!! Got it working! It took me awhile to respond because my email account got shut down AND I lost my login password so I had to create another account to login. >:( Had a bad day...)

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Can you update a TouchScreen variable by reading serial data?
« Reply #3 on: March 04, 2011, 12:50:31 pm »
Would you like me to delete the new account and reset your password and email address on your original account?
John Hughes
Codecore Technologies