T
test
Hi, I'm very new to Javascript so maybe my question could be stupid.
I'm playing with microcontrollers and a TCP/IP component.
This means that I can control electronics via TCP/IP, UDP and so on.
But, my problem is on the client side.
I want to have a program, or a web page containing buttons that, when
pressed sends a signal to the TCP/IP component and waits for a
response back.
Maybe this seems strange, but let's say I have a connection on port 80
and I click a radio button on a web page, the new information is send
(like with a "get" command) to the TCP/IP component.
That analyses the new command en sends a confirmation back.
In real this would be a web page that has 2 times 8 radio buttons that
sends information for 8 lamps.
The way the information is send by the Javascriot doesn't matter.
The TCP/IP component replies after the information is processed.
Lets say someone clicks "lamp1" from "OFF" to "ON"
The script should send a code that represents the state of the buttons
on the page
"A1,B0,C1,E0,F0,G0H0,I0"
This means that lamp A, C are ON, the rest is OFF.
The TCP/IP component checks if this can be done and replies:
"A1,B0,C1,E0,F0,G0H0,I0"
The same as the command send by the script.
The script reacts by visualize the new state.
In a later stage, the input should be a 8byte word.
So the 8 lamps should become textboxes that can contain numbers from 0
to 255.
This is but a draft version of this question, if it seems that
Javascript is not the best way to do this, I won't bother you anymore
Thanks for your help
I'm playing with microcontrollers and a TCP/IP component.
This means that I can control electronics via TCP/IP, UDP and so on.
But, my problem is on the client side.
I want to have a program, or a web page containing buttons that, when
pressed sends a signal to the TCP/IP component and waits for a
response back.
Maybe this seems strange, but let's say I have a connection on port 80
and I click a radio button on a web page, the new information is send
(like with a "get" command) to the TCP/IP component.
That analyses the new command en sends a confirmation back.
In real this would be a web page that has 2 times 8 radio buttons that
sends information for 8 lamps.
The way the information is send by the Javascriot doesn't matter.
The TCP/IP component replies after the information is processed.
Lets say someone clicks "lamp1" from "OFF" to "ON"
The script should send a code that represents the state of the buttons
on the page
"A1,B0,C1,E0,F0,G0H0,I0"
This means that lamp A, C are ON, the rest is OFF.
The TCP/IP component checks if this can be done and replies:
"A1,B0,C1,E0,F0,G0H0,I0"
The same as the command send by the script.
The script reacts by visualize the new state.
In a later stage, the input should be a 8byte word.
So the 8 lamps should become textboxes that can contain numbers from 0
to 255.
This is but a draft version of this question, if it seems that
Javascript is not the best way to do this, I won't bother you anymore
Thanks for your help