You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a very dump version of this goal, but a working minimal start version:
I'm writing a content.txt with my python script which is inserted in index.html with java script.
Extract from python script:
[...]
datei = open ("./text/content.txt", "w")
datei.write('charge {} - {} V - {} lx - {} cm - {} C - {}'.format(dig0, voltage, 1023-ana3, distance, temperature, bitrate))
datei.close()
[...]
index.html:
[...]
<head>
<!-- Messwerte ausgeben -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
var loadContent = function(){
var url = 'text/content.txt'; //Pfad zur .txt-Datei
$.ajax({
url: url,
dataType: 'text',
success : function(data){
$('#meinText').empty();
$('#meinText').append(data); //Der Inhalt aus der txt-Datei wird in das DIV 'meinText' geschrieben.
}
})
}
</script>
<title>PiCraft</title>
[...]
<body>
<div id="meinText" style="font-family: sans-serif; color:white; text-align: center; position:fixed; min-height: 24px; padding-top:3px; width: 100%; background-color:grey">
</div>
<script>
var myInterval = window.setInterval(loadContent, 250);
loadContent();
</script>
[...]
Would be clever to mount a ram-disk to folder "text" for not damage the sd-card.
No description provided.
The text was updated successfully, but these errors were encountered: