SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By Blenderite
#196100
Hello all!

I have a little bit of an unusual need. I want to make a touch screen widget that will control relays on my truck.

I will need it to: accept and monitor for changes on multiple inputs at the same time, have a touch screen button interface, have the ability to reprogram the screen to change the button layout without removing the module from the vehicle, be able to control multiple (probably no more than 12) relays and potentially at the same time.

Correct me if I am wrong, but isn't Arduino a single thread processor? It can only monitor a single input at a time? What would be the best board to control this?

If you guys could give me a little guidance, I would appreciate it. Thanks!
By Anthony Fremont
#196101
Yes, I guess you could say it's single thread, but you can use interrupts to detect changes on input pins. You can also use a timer interrupt to poll or scan for things and then process them at main level. I don't know the specifics of your touch screen, but I'm guessing it can generate an interrupt somehow, or you could poll it several times per second. It sounds to me like the Arduino is plenty capable of doing the job, you just have to be a little creative with your code. You might want to post your question to the Arduino forum. Lots of activity over there.

Sent from my Moto G (4) using Tapatalk
By markaren1
#196194
You can easily monitor multiple inputs and control multiple outputs from a single-threaded CPU. From you requirements, how about using a smart-phone connected (by WiFi) to an ESP-8266 which is the web-server, and is also doing the heavy(!) lifting. Have a look at micro-python for that target. -Mark
By lyndon
#196201
I did something like this but I used a Raspberry pi since it was simpler. Maybe I should put details on my blog?