<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:atom="http://www.w3.org/2005/Atom">

<channel>

<title>timsa.ru: заметки с тегом raspberry</title>
<link>https://timsa.ru/tags/raspberry/</link>
<description>Моя записная книжка. Комментарии отключены из-за спама. Для вопросов используйте эту страничку</description>
<author></author>
<language>ru</language>
<generator>Aegea 11.0 (v4079)</generator>

<itunes:subtitle>Моя записная книжка. Комментарии отключены из-за спама. Для вопросов используйте эту страничку</itunes:subtitle>
<itunes:image href="" />
<itunes:explicit></itunes:explicit>

<item>
<title>Beacon</title>
<guid isPermaLink="false">232</guid>
<link>https://timsa.ru/all/beacon/</link>
<pubDate>Fri, 06 Jun 2025 17:26:15 +0500</pubDate>
<author></author>
<comments>https://timsa.ru/all/beacon/</comments>
<description>
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;import uasyncio as asyncio
from machine import Pin,ADC,PWM,UART
import utime
import math

uart = UART(0, baudrate=9600, tx=Pin(0), rx=Pin(1))
#uart = UART(1, baudrate=9600, tx=Pin(4), rx=Pin(5))
uart.init(bits=8, parity=None, stop=1)

async def readuart():
    while True:
        if uart.any():
            data = uart.read()
            print(data)
        await asyncio.sleep_ms(1000)

async def heartbeat():
    temp_sensor = ADC(4)
    while True:
        current_time = utime.localtime()
        hours = current_time[3]
        minutes = current_time[4]
        seconds = current_time[5]
        temp = 27 - (temp_sensor.read_u16() * 3.3 / (65535) - 0.706)/0.001721
        #print(&amp;quot;{:02d}:{:02d}:{:02d} t={:3.1f}&amp;quot;.format(hours, minutes, seconds, temp))
        uart.write(&amp;quot;{:02d}:{:02d}:{:02d} t={:3.1f}&amp;quot;.format(hours, minutes, seconds, temp))
        await asyncio.sleep_ms(60000)

async def ledlight():
    #led = Pin(25, Pin.OUT)
    led = PWM(Pin(25, Pin.OUT))
    led.freq(2048)
    
    start_value = 1
    end_value = 65535
    num_values = 100
    growth_factor = (end_value / start_value) ** (1 / (num_values - 1))
    decay_factor = (start_value / end_value) ** (1 / (num_values - 1))
    
    while True:
        for i in range(num_values):
            value = start_value * (growth_factor ** i)
            led.duty_u16(int(value))
            await asyncio.sleep_ms(int(500/num_values))
            
        for i in range(num_values):
            value = end_value * (decay_factor ** i)
            led.duty_u16(int(value))
            await asyncio.sleep_ms(int(500/num_values))
            
async def main():
    loop  =  asyncio.get_event_loop ()
    loop.create_task(heartbeat())
    loop.create_task(ledlight())
    loop.create_task(readuart())
    loop.run_forever ()

if __name__ == '__main__':
    asyncio.run(main())&lt;/code&gt;&lt;/pre&gt;</description>
</item>

<item>
<title>Raspberry Pi Pico 2</title>
<guid isPermaLink="false">231</guid>
<link>https://timsa.ru/all/raspberry-pi-pico-2/</link>
<pubDate>Wed, 04 Jun 2025 13:23:23 +0500</pubDate>
<author></author>
<comments>https://timsa.ru/all/raspberry-pi-pico-2/</comments>
<description>
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://timsa.ru/pictures/image-6.png" width="960" height="486" alt="" /&gt;
&lt;/div&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://timsa.ru/pictures/image-4.png" width="960" height="780" alt="" /&gt;
&lt;/div&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://timsa.ru/pictures/image-5.png" width="960" height="472" alt="" /&gt;
&lt;/div&gt;
</description>
</item>

<item>
<title>Raspberry Pi 1 Model B Rev 2</title>
<guid isPermaLink="false">182</guid>
<link>https://timsa.ru/all/raspberry-pi-1-model-b-rev-2/</link>
<pubDate>Sat, 02 Dec 2023 22:15:24 +0500</pubDate>
<author></author>
<comments>https://timsa.ru/all/raspberry-pi-1-model-b-rev-2/</comments>
<description>
&lt;p&gt;Разрядом убита сетевуха, всё остальное работает.&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://timsa.ru/pictures/Raspberry-Pi-1-Model-B-Rev-2.png" width="1280" height="868" alt="" /&gt;
&lt;/div&gt;
&lt;div class="e2-text-picture"&gt;
&lt;img src="https://timsa.ru/pictures/Raspberry-Pi-1-Model-B-5.jpg" width="600" height="1074" alt="" /&gt;
&lt;/div&gt;
</description>
</item>


</channel>
</rss>