A lab report by Zwee Dao
- Upload a video of your version of the camera lab to your lab Github repository
- As usual, update your class Hub repository to add your forked IDD-Fa18-Lab7 repository.
- Answer the questions in-line below on your README.md.
a. Link to a video of your HelloYou sketch running.
a. Compare helloYou/server.js
and IDD-Fa18-Lab7/pictureServer.js
. What elements had to be added or changed to enable the web camera? (Hint: It might be good to know that there is a UNIX command called diff
that compares files.)
I edit the SERIAL COMMUNICATION (Arduino)
part to be like below:
//---------------------- SERIAL COMMUNICATION (Arduino) ----------------------//
// start the serial port connection and read on newlines
const serial = new SerialPort(process.argv[2], {});
const parser = new Readline({
delimiter: '\r\n'
});
// Read data that is available on the serial port and send it to the websocket
serial.pipe(parser);
parser.on('data', function(data) {
console.log('Data:', data);
io.emit('server-msg', data);
if (data == 'light') {
var imageName = new Date().toString().replace(/[&\/\\#,+()$~%.'":*?<>{}\s-]/g, '');
console.log('making a making a picture at'+ imageName);
NodeWebcam.capture('public/'+imageName, opts, function( err, data ) {
io.emit('newPicture',(imageName+'.jpg'));
})
}
});
//----------------------------------------------------------------------------//
b. Include a video of your working video doorbell
a. Find, install, and try out a node-based library and try to incorporate into your lab. Document your successes and failures (totally okay!) for your writeup. This will help others in class figure out cool new tools and capabilities.
b. Upload a video of your working modified project