Can PINK run Java Script
NWCCTV
Posts: 3,629
I got my PINK working and am able to upload web pages to it. My next issue/question is can a PINK run Java script? I want to be able to control my Prop this way. Which, in turn, leads to my next question for all you Java gurus. I am familiar with html programming but have never coded in Java. What is a good quick and easy way to get up and running? Basically I just want to create a web page that has a menu with buttons that will control features on my Prop that are connected through the PINK.
Edit: If there is an easier way to accomplish this by all means let me know.
Edit: If there is an easier way to accomplish this by all means let me know.
Comments
The way this works is that the Propeller talks over the serial connection to the PINK. The various PINK commands allow the Prop to read and set a bunch of string variables in the PINK that can be incorporated into the HTML being served up. In the HTML, you can set up a menu that causes specific values to be placed into these string variables which the Prop can read. Similarly, you can set up buttons which, when clicked, change a value in one of these string variables. Essentially, the HTML causes the browser to send a message over the Internet to the PINK and the PINK changes a specified string variable to a value that's also sent.
Edit: I would appreciate it if anyone can point me in the right direction. Just to get started if I can click on a button on a web page that is loaded on the PINK and have it turn on an LED that will get me closer to my goal and I should be able to figure it out after that.
Yes. You have the Pink web page java script create a button that toggles between on/off. When the browser reads that java script it creates the button. When you click on the button the browser sends information back to the Pink. The pink uses that information to set a variable that your prop can read, and you can use that variable to control the led.
Sorry, I don't have an example. That was a project I worked on before I became a prop convert. It was done with a different microprocessor and an 80386 based SBC in place of the Pink. Perhaps Phil or Bits could help. IIRC they posted info on something similar a while back.
shows you how to write and read the variables for a basic stamp,you could use the OBEX object that uses basic stamp commands on the prop or convert the examples yourself to the prop.