-
-
Save cebbus/d34d83e305701024b9cb15212f28abab to your computer and use it in GitHub Desktop.
Blocking kod örneği
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var newPanelData = new PanelData({ //rastgele veri oluşturuluyor (panelden verinin gelmesi) | |
panelId: key, | |
current: parseInt(Math.random()*1000), | |
voltage: parseInt(Math.random()*1000), | |
light: parseInt(Math.random()*100), | |
temperature: parseInt(Math.random()*100), | |
moisture: parseInt(Math.random()*100), | |
date: new Date() | |
}); | |
newPanelData.save(); //verinin veri tabanına kaydedilmesi | |
console.log('Veri kaydedildi. Panel id : ' + newPanelData.panelId); //log | |
io.emit('retrievePanelData', newPanelData); //gelen verinin kullanıcılara gönderilmesi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment