top of page

Connect Arduino & Browser

The basic idea of this assignment is to create a connected device that does not rely on P5.

The structure of how it works is like this: 

             Arduino stores the captured data in JSON and send to serial. 

             JS requests data from the serial and controls the web page structured by HTML.

Question

1. I write a CSS file, however, how can I see the web page? What's it's URL?

CSS is the style. HTML is the structure. JS is the behaviour. So, the layout should be written in a HTML file. Then hit debug and run, the page will open in the browser. 

2. What is the <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/p5.min.js">? Why do I need it?

Need to include a P5js library and a P5serial library to use the serial functions.

3. How does the JS file request data from the exact JSON? How does it refer to the JSON it needs?

The arduino sends it via serial.println();

4. When to use double quotation mark, when to use single quotation mark?

Doesn't matter. 

Span is like varaibles, it can be changed. 

let thisSpan=document.getElementById('');

thisSpan.innerHTML= currentValue;

Set the value of the slider to make the slider move along to the sensor.

knob.value=currentValue;

List before open

serial.list();

serial.open("/dev/tty.usbmodem14101");

Reading

There Will Come Soft Rains is a very interesting work! The computers provide perfect service, but no one take advantage of it. A tricky setting that catches my attention is that the machines have done all the work at home, but they ask the house owner to go to work. In such a world with all the advanced machines, do people really need to work by themselves?  Maybe in that world, "working" is just a mean to fight against boredom.

When I finish reading the whole story, I suddenly have on idea if this house is intelligent or stupid. An example is the stove makes more food after the prepared food are done. However, it did not know that the consumer of the food is the fire. Seems like all the devices are programmed well in a narrow area, but have neither flexibility nor ability to make an overall decisions.

 

The machines are excellent helpers, but not eligible house owners.  

This story also illustrates the world depicted by The Computer for the 21st Century in which computers vanish into daily life. These two articles form a great contrast and forces the readers to consider what kind of technologies we want and  what standard we should apply to examinate the intelligence level of a computer. 

bottom of page