ANTIRTOS v0.1.3 Released: Introducing Delayed Function Execution Make It Super Easy And Fast
- Информация о материале
- Автор: Super User
- Родительская категория: Заметки
- Категория: Программирование микроконтроллеров
- Просмотров: 1093
ANTIRTOS v0.1.3 Released: Introducing Delayed Function Execution
We are excited to announce the release of ANTIRTOS v0.1.3, now available on GitHub. This release introduces a powerful new feature: delayed function execution. This enhancement allows developers to schedule functions to be executed after a specified delay, simplifying the management of timed operations in IoT and embedded systems.
Key Feature: Delayed Function Execution
The delayed function execution feature in ANTIRTOS v0.1.3 provides a straightforward mechanism to schedule functions to run after a certain delay, measured in ticks. This is particularly useful for time-dependent tasks in IoT and embedded applications.
Initializing the Delayed Function Queue
To utilize the delayed function feature, initialize a delayed function queue as follows:
del_fQ F5(8); // Create a delayed queue with a capacity of 8
Adding Functions to the Queue
You can add functions to the delayed queue, specifying the delay in ticks. Here’s how you can schedule two functions with different delays:
F5.push_delayed(your_func_1, 1000); // Schedule your_func_1() to be executed after 1000 ticks
F5.push_delayed(your_func_2, 2000); // Schedule your_func_2() to be executed after 2000 ticks
Executing the Delayed Functions
In your main loop or any other periodic loop, call the pull method to execute the functions when their delay has elapsed. This function is highly efficient and can be executed quickly:
void loop() {
.......
F5.pull(); // Execute the scheduled functions
}
Tick Management
To manage the passage of ticks, call the tick method in a timer or another periodic function. This keeps the queue aware of the timing and ensures that functions are executed at the correct time:
F5.tick(); // Update the queue with the passage of ticks
Getting Started with ANTIRTOS v0.1.3
To explore the new delayed function execution feature and other improvements, visit the . The repository includes example projects.
git clone https://github.com/WeSpeakEnglish/ANTIRTOS.git
cd antirtos
Developers are encouraged to try out the new features, contribute to the project, and provide feedback.
About ANTIRTOS
ANTIRTOS is an ultra-lightweight, universal C++ library designed for task management in IoT and embedded applications. It is coded in a single, small file of just 5KB, making it incredibly easy to integrate into your projects. ANTIRTOS aims to deliver a robust, secure, and efficient platform for task management. With its focus on modularity and scalability, ANTIRTOS is suitable for a variety of devices, from simple microcontrollers to complex embedded systems.
Пара слайдеров на чистом HTML + Vanilla JS без использования input type = slider
- Информация о материале
- Автор: Super User
- Категория: Новости
- Просмотров: 1088
<!DOCTYPE html>
<html>
<head>
<title>Linear Sliders</title>
<style>
.slider-container {
width: 300px;
margin: 20px auto;
text-align: center;
}
.slider {
width: 100%;
height: 30px;
position: relative;
background: linear-gradient(to right, darkblue, white, darkred);
margin-bottom: 20px;
}
.center-line {
position: absolute;
width: 2px;
height: 100%;
background-color: #000;
left: 50%;
top: 0;
}
.handle {
width: 10px;
height: 30px;
background-color: #000;
position: absolute;
cursor: pointer;
margin-left: -5px;
}
.value-input {
width: 60px;
font-size: 20px;
text-align: center;
}
</style>
</head>
<body>
<div id="slider1-container" class="slider-container">
<div id="slider1" class="slider">
<div class="center-line"></div>
<div id="handle1" class="handle"></div>
</div>
<input type="number" id="value1-input" class="value-input" step="0.1" value="0.0">
</div>
<div id="slider2-container" class="slider-container">
<div id="slider2" class="slider">
<div class="center-line"></div>
<div id="handle2" class="handle"></div>
</div>
<input type="number" id="value2-input" class="value-input" step="0.1" value="0.0">
</div>
<script>
function initializeSlider(sliderId, handleId, inputId) {
var slider = document.getElementById(sliderId);
var handle = document.getElementById(handleId);
var valueInput = document.getElementById(inputId);
function setHandlePosition(value) {
var sliderRect = slider.getBoundingClientRect();
var newLeft = ((value + 60) / 120) * sliderRect.width;
handle.style.left = newLeft + 'px';
}
// Initial handle position
setHandlePosition(0);
handle.onmousedown = function(event) {
event.preventDefault();
document.onmousemove = function(event) {
var sliderRect = slider.getBoundingClientRect();
var newLeft = event.clientX - sliderRect.left;
if (newLeft < 0) newLeft = 0;
if (newLeft > sliderRect.width) newLeft = sliderRect.width;
handle.style.left = newLeft + 'px';
var value = ((newLeft / sliderRect.width) * 120 - 60).toFixed(1);
valueInput.value = value;
};
document.onmouseup = function() {
document.onmousemove = null;
document.onmouseup = null;
};
};
valueInput.onchange = function() {
var value = parseFloat(valueInput.value);
if (isNaN(value)) {
value = 0;
}
if (value < -60) value = -60;
if (value > 60) value = 60;
setHandlePosition(value);
};
}
initializeSlider('slider1', 'handle1', 'value1-input');
initializeSlider('slider2', 'handle2', 'value2-input');
</script>
</body>
</html>
Combining E24 resistors to get best match in gain of inverting and non-inverting amplifiers: python
- Информация о материале
- Автор: Super User
- Родительская категория: Заметки
- Категория: Программирование
- Просмотров: 949
- E24 Resistor Series: Defines the standard E24 resistor values and scales them to a wide range of standard resistor values.
- Helper Functions: Functions to calculate series and parallel resistances, find the closest resistor value, and find resistor combinations.
- Inverting Amplifier Calculation: Calculates the necessary resistors for an inverting amplifier based on the desired gain, and checks for the best resistor combinations.
- Non-Inverting Amplifier Calculation: Calculates the necessary resistors for a non-inverting amplifier based on the desired gain, and checks for the best resistor combinations.
- Main Execution: Takes the desired gain as input, calculates the necessary resistors for both inverting and non-inverting amplifiers, and prints the results, including the calculated gain based on the selected resistors.
#inverting opamp: Uout = -(Rf / Rin)*Uin
#non inverting: Vout = (1 + Rf/Rin)*Vin
import itertools
import numpy as np
# Define E24 series resistors
E24_values = np.array([
1.0, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.7, 3.0,
3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5, 8.2, 9.1
])
# Scale E24 values to standard resistor range
E24_resistors = np.unique([round(r * (10 ** exp), 1) for r in E24_values for exp in range(0, 7)])
# Helper functions to calculate series and parallel resistances
def series_resistance(resistors):
return sum(resistors)
def parallel_resistance(resistors):
return 1.0 / sum(1.0 / r for r in resistors)
# Function to find closest E24 resistor value
def closest_resistor(target, resistors):
return min(resistors, key=lambda x: abs(x - target))
# Function to find resistor combinations
def find_resistor_combination(target_resistance, resistors, max_combinations=2, tolerance=0.1):
# Check if single resistor is close enough
closest = closest_resistor(target_resistance, resistors)
if abs(closest - target_resistance) < tolerance:
return [closest], "single"
# Check combinations of up to max_combinations resistors in series
for n in range(2, max_combinations + 1):
for combination in itertools.combinations_with_replacement(resistors, n):
if abs(series_resistance(combination) - target_resistance) < tolerance:
return list(combination), "series"
# Check combinations of up to max_combinations resistors in parallel
for n in range(2, max_combinations + 1):
for combination in itertools.combinations_with_replacement(resistors, n):
if abs(parallel_resistance(combination) - target_resistance) < tolerance:
return list(combination), "parallel"
return [], "none"
# Function to calculate resistors for inverting amplifier
def calculate_inverting_resistors(gain):
R1_value = 10.0
R_f_value = R1_value * gain
R_f_combination, R_f_type = find_resistor_combination(R_f_value, E24_resistors)
R1_combination, R1_type = find_resistor_combination(R1_value, E24_resistors)
final_R_f_value = series_resistance(R_f_combination) if R_f_type == "series" else parallel_resistance(R_f_combination)
final_R1_value = series_resistance(R1_combination) if R1_type == "series" else parallel_resistance(R1_combination)
calculated_gain = final_R_f_value / final_R1_value
return {
"gain": gain,
"calculated_gain": calculated_gain,
"R_f": {"value": final_R_f_value, "combination": R_f_combination, "type": R_f_type},
"R1": {"value": final_R1_value, "combination": R1_combination, "type": R1_type}
}
# Function to calculate resistors for non-inverting amplifier
def calculate_non_inverting_resistors(gain):
R1_value = 10.0
R_f_value = R1_value * (gain - 1)
R_f_combination, R_f_type = find_resistor_combination(R_f_value, E24_resistors)
R1_combination, R1_type = find_resistor_combination(R1_value, E24_resistors)
final_R_f_value = series_resistance(R_f_combination) if R_f_type == "series" else parallel_resistance(R_f_combination)
final_R1_value = series_resistance(R1_combination) if R1_type == "series" else parallel_resistance(R1_combination)
calculated_gain = 1 + (final_R_f_value / final_R1_value)
return {
"gain": gain,
"calculated_gain": calculated_gain,
"R_f": {"value": final_R_f_value, "combination": R_f_combination, "type": R_f_type},
"R1": {"value": final_R1_value, "combination": R1_combination, "type": R1_type}
}
# Input gain
gain = float(input("Enter the desired gain: "))
# Calculate resistors for inverting and non-inverting amplifiers
inverting_result = calculate_inverting_resistors(gain)
non_inverting_result = calculate_non_inverting_resistors(gain)
# Output the result for both inverting and non-inverting configurations
print(f"Desired Gain: {gain}")
print("\nInverting Amplifier:")
print(f"Calculated Gain: {inverting_result['calculated_gain']:.2f}")
print(f"Feedback Resistor (R_f) value: {inverting_result['R_f']['value']} ohms")
print(f"R_f combination: {inverting_result['R_f']['combination']} ({inverting_result['R_f']['type']})")
print(f"Input Resistor (R1) value: {inverting_result['R1']['value']} ohms")
print(f"R1 combination: {inverting_result['R1']['combination']} ({inverting_result['R1']['type']})")
print("\nNon-Inverting Amplifier:")
print(f"Calculated Gain: {non_inverting_result['calculated_gain']:.2f}")
print(f"Feedback Resistor (R_f) value: {non_inverting_result['R_f']['value']} ohms")
print(f"R_f combination: {non_inverting_result['R_f']['combination']} ({non_inverting_result['R_f']['type']})")
print(f"Ground Resistor (R1) value: {non_inverting_result['R1']['value']} ohms")
print(f"R1 combination: {non_inverting_result['R1']['combination']} ({non_inverting_result['R1']['type']})")
kolecka do sprhy
- Информация о материале
- Автор: Super User
- Родительская категория: Заметки
- Категория: Жизнь
- Просмотров: 813
https://www.temu.com/ul/kuiper/un9.html?subj=goods-un&_bg_fs=1&_p_jump_id=894&_x_vst_scene=adg&goods_id=601099519016390&sku_id=17592226812693&adg_ctx=a-06b53c7d~c-c14a7b45~f-a052c1d3&_x_ads_sub_channel=shopping&_p_rfs=1&_x_ns_prz_type=3&_x_ns_sku_id=17592226812693&mrk_rec=1&_x_ads_channel=google&_x_gmc_account=5076073857&_x_login_type=Google&_x_ads_account=6799709807&_x_ads_set=20588780596&_x_ads_id=152615004694&_x_ads_creative_id=675137739977&_x_ns_source=g&_x_ns_gclid=CjwKCAjwjqWzBhAqEiwAQmtgT0xPHEfEEOId7sbXMare9ImDTub5AqwcaBVs7Oww96GgJeDv3lV47BoCGpkQAvD_BwE&_x_ns_placement=&_x_ns_match_type=&_x_ns_ad_position=&_x_ns_product_id=17592226812693&_x_ns_target=&_x_ns_devicemodel=&_x_ns_wbraid=Cj8KCQjw65-zBhCqARIuAIi9DfEGvetfutj8xiJBQ5Mg5tk0_Wa4uFY0ymriBPq17vnUYF40hiHuZLGWwxoCtIE&_x_ns_gbraid=0AAAAAo4mICFn9dUP2q6rxps22WGmrjtXH&_x_ns_targetid=pla-2201593715676&gad_source=1&gclid=CjwKCAjwjqWzBhAqEiwAQmtgT0xPHEfEEOId7sbXMare9ImDTub5AqwcaBVs7Oww96GgJeDv3lV47BoCGpkQAvD_BwE
https://allegro.cz/nabidka/kolecka-pro-sprchovou-kabinu-kolecka-sada-kolecka-valecek-sprchove-kabiny-14686197526?utm_feed=712e6653-4749-4512-b084-b6e297fc9e0b&utm_source=google&utm_medium=cpc&utm_campaign=CZ%3EHome%3EP%26S%3EPMAX&ev_campaign_id=20751747990&gad_source=1&gclid=CjwKCAjwjqWzBhAqEiwAQmtgTytnGX9nCIsm0mdaRMbqEDA5qilf4MwCDuUROJi9R7gD22kY9ah1ohoC3tcQAvD_BwE
https://allegro.cz/nabidka/dvojita-role-sprchovych-koutu-26-mm-12179237270?utm_feed=712e6653-4749-4512-b084-b6e297fc9e0b&utm_source=google&utm_medium=cpc&utm_campaign=CZ%3EHome%3EBathroom%3E3P%3EPMAX&ev_campaign_id=20027777979&gad_source=1&gclid=CjwKCAjwjqWzBhAqEiwAQmtgT-vy6rmaPSMwjr-nnw7z8EuZb6qVkaMWrVXXYwRoMdCF0-AuQn6YYBoCmKAQAvD_BwE
Artemisia annua против Helicobacter pylori
- Информация о материале
- Автор: Super User
- Родительская категория: Заметки
- Категория: Лечение
- Просмотров: 1012
Artemisia annua, известная как сладкий полынь, демонстрирует перспективную активность против Helicobacter pylori (H. pylori), бактерии, ответственной за многие желудочно-кишечные заболевания, включая пептические язвы и гастрит.
Артемизинин и его производные
Артемизинин, соединение, полученное из Artemisia annua, и его производные (такие как артесунат и дигидроартемизинин) были исследованы на предмет их антибактериальных свойств против H. pylori. Исследования показали, что эти соединения оказывают значительное ингибирующее действие на H. pylori. Например, арил-аминоартемизинин (GC012), полученный из дигидроартемизинина, показал мощную бактерицидную активность против различных клинических штаммов H. pylori. Это соединение также продемонстрировало синергизм с обычными антибиотиками, такими как метронидазол, кларитромицин и амоксициллин, усиливая их эффективность против H. pylori и подавляя образование биопленок, что важно для выживания и устойчивости бактерий ().
Сравнительная активность
По сравнению с другими видами рода Artemisia, Artemisia ludoviciana subsp. mexicana также проявила сильную анти-H. pylori активность. Основные биоактивные компоненты, выделенные из этого растения, такие как эстефиатин и эупатилин, эффективно ингибировали рост H. pylori, с минимальными бактерицидными концентрациями (МБК), значительно ниже, чем у многих стандартных методов лечения. Эти результаты подчеркивают потенциал видов Artemisia в разработке альтернативных методов лечения заболеваний, связанных с H. pylori ().
Механизмы действия
Антибактериальная активность соединений артемизинина против H. pylori включает разрушение целостности бактериальной мембраны и ингибирование образования биопленок, что является защитным способом роста бактерий. Эти механизмы помогают снизить колонизацию и выживаемость бактерий в желудочной среде, делая артемизинин и его производные перспективными кандидатами для дополнительной терапии в стратегиях эрадикации H. pylori.
Таким образом, Artemisia annua и ее соединения предлагают потенциальную альтернативу или дополнительный вариант лечения инфекций H. pylori, особенно в контексте растущей устойчивости к антибиотикам. Необходимы дальнейшие клинические исследования для полного установления их эффективности и профиля безопасности.
Для получения более подробной информации вы можете ознакомиться с исследованиями, опубликованными в журналах и , касающихся антимикробных свойств Artemisia annua и связанных видов против H. pylori.
Страница 23 из 197

