JAVA SCRPIT - INTERNET OF THINGS

image

Today, many objects have the potential to be connected to the internet to generate data that is useful for a person's decision making, or even communicate with other items, such as Amazon's Alexa.

We can, through pre-programmed commands, turn lights on or off throughout the house, in a certain environment, or even change the color of lamps that have technology to connect to each other. We call this process IoT or Internet of Things, where we have several objects such as smartphones, headphones, televisions, video games, smartwatches connected to each other, generating different actions. A good example is when we change music on the smartwatch and another action takes place on the cell phone, or when we change music on the computer by buttons on the wireless headphones.

We have several programming languages ​​that work very well with this IoT process, such as C, C++, Java, Python and Javascript. In the beginning, Javascript was only used to add functionality to web pages. Nowadays, with Node.js, we can expand to other horizons, from web servers and database manipulation to game creation.

Many IoT devices already have the ability to run Node.js β€” which is simply a Javascript code interpreter β€” without needing to access a web page. Thus, we were able to add, for example, communication with the Arduino (which works similar to that of a small computer) through libraries, such as CylonJS. With them, we can make connections with sensors connected to the hardware, and from there, perform various commands; from activating or deactivating leds connected to Arduino to changing their colors by Node.js using Javascript.

image

There are several other Node.js libraries that give us several possibilities to explore the Internet of Things. With those that communicate via Bluetooth, with devices like gort.io, we can create commands in Node.js that change the television channel, or that increase the volume of speakers that support this type of connection, and also exchange songs on the cell phone via pre-programmed commands.

As you can see throughout the text, through the libraries already developed by communities in Javascript, we can use them in addition to Node.js to automate day-to-day tasks, connecting our devices to each other and performing actions programmed by ourselves. . And it all depends on your imagination, need and creativity: the possibilities are endless! So, take the opportunity to explore libraries and integrate them with your devices to start venturing into this world of IoT with Javascript!