Arduino
TM1638
Medidor de inductancia
TM1638
Medidor de inductancia
VERSIÓN_2
https://seta43.blogspot.com/2019/07/arduino-tm1638-medidor-de-inductancia-v3_81.html
VERSIÓN_2
https://seta43.blogspot.com/2019/07/arduino-tm1638-medidor-de-inductancia-v3_81.html
PRESCALER P0 (0M1-0M0) |
0 MCLK /1 66,6 MHz 1 MCLK /2 33,3 MHz 2 MCLK /4 15,65 MHz 3 MCLK /8 8,32 MHz |
PRESCALER P1 (1M1-1M0) |
0 MCLK /1 66,6 MHz 1 MCLK /2 33,3 MHz 2 MCLK /4 15,65 MHz 3 MCLK /8 8,32 MHz |
DIV | DIV-decimal | DIVISOR |
0 000 000 000 0 000 000 001 0 000 000 010 0 000 000 011 1 111 111 111 | 0 1 2 3 1023 | /2 /3 /4 /5 /1025 |
DS1077_ADDRESS 0b1011000 Access DIV [01] If R/ W is 0, this command writes to the DIV register. After issuing this command, the next data byte value is to be written into the DIV register. If R/ W is 1, the next data byte read is the value stored in the DIV register. Access MUX [02] If R/ W is 0, this command writes to the MUX register. After issuing this command, the next data byte value is to be written into the MUX register. If R/ W is 1, the next data byte read is the value stored in the MUX register. Access BUS [0D] If R/ W is 0, this command writes to the BUS register. After issuing this command, the next data byte value is to be written into the BUS register. If R/ W is 1, the next data byte read is the value stored in the BUS register. Write E2 [3F] If WC = 0 the EEPROM is automatically written to at the end of each command. This is a DEFAULT condition. In this case the command WRITE E2 is not needed. |
Comandos reconocidos |
MDIV [0-1] Activar prescaler [0=enable, 1=disable] DIVX [0-1023] Divider dividir[2-1025] 00000000 00000000 /2 00000000 00000001 /3 00000000 00000010 /4 00000000 00000011 /5 MX0M [0-3] Prescaler 0 div[1,2,4,8] MX1M [0-3] Prescaler 1 div[1,2,4,8] FREB [Frecuencia KHz] Default=66666 FREC [Frecuencia] LIST Lista todos los estados RDIV [0-65536] RMUX [0-65536] RBUS [0-65536] RWRI [0-65536] |
Código de creación de la gráfica de temperatura. |
fig = plt.figure() ax = fig.add_subplot(1,1,1) major_ticks = np.arange(0, 240, 30) ax.set_xticks(major_ticks) ax.grid(which='major', alpha=1) plt.xlabel("Temperatura DIA "+ time.strftime("%d_%m_20%y")) plt.plot(listaTemp,color='red') plt.xlim(0,240) plt.ion() my_dpi=75 plt.savefig("gra2.png",dpi=my_dpi) |
Código de creación de la doble gráfica de humedad y presión. |
fig, (ax1, ax2) = plt.subplots(2, sharex=True,) plt.xlim(0,240) ax1.plot(listaHume,color='blue') ax1.set(ylabel='Humedad %') plt.xlim(0,240) ax2.plot(listaPres,color='green') plt.setp(ax2.get_xticklabels(), fontsize=9) major_ticks = np.arange(0, 240, 30) ax2.set_xticks(major_ticks) ax2.set(ylabel='Bares') plt.xlabel("HORA "+time.strftime("%H:%M")) my_dpi=75 plt.savefig("gra1.png",dpi=my_dpi) |
gratem.sh |
#!/bin/bash echo "GENERANDO GRAFICOS" cd $HOME/www/webcam $HOME/www/webcam/gratem.py |
Formato de datos |
INICIO Temperatura,14.0 Humedad,32 #presion,923 #Temperatura,26.1 FINAL |
nombreFichero="Temp20"+time.strftime("%y_%m_%d")+".csv" f = open(nombreFichero,'a') f.write(time.strftime("%H,%M")) f.write(',') f.write(dTemperatura+','+dHumedad+','+dPresion+','+'\n') f.close() |
Formato del fichero de datos metereológicos |
00,00,21.6,25,924, 00,01,21.6,25,924, 00,02,21.6,25,924, 00,03,21.6,25,924, 00,04,21.5,25,924, |
print "Crear pagina" fw = open('index.html','w') mensajeWeb = """ <html> <head> <meta http-equiv="refresh" content="115"> <title>PALENCIA</title> </head> <body bgcolor="#ffff99"> <h2>Palencia, Spain <hr size="2" width="100%"> <img alt="" src="web.jpg" height="480" width="640"><br> <hr size="2" width="100%"> """ mensajeWeb = mensajeWeb + time.strftime("%d/%m/%y") +" "+ time.strftime("%H:%M:%S") mensajeWeb = mensajeWeb + """<br>""" mensajeWeb = mensajeWeb + mensaje mensajeWeb = mensajeWeb + """ <h2><a href="gradia.html">GRAFICOS</a><br> <img alt="" src="mapa.png" > </h2> </body> </html>""" fw.write(mensajeWeb) fw.close() |
app_python.sh |
#!/bin/bash cd /home/seta/www/webcam xterm -e "python camtem4.py" |