2024-08-05_11-17

This commit is contained in:
ocogeclub 2024-08-05 11:17:09 +09:00
parent 2515a560b1
commit 1648584e9a
35 changed files with 277 additions and 629 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,28 +6,6 @@
$ sudo systemctl start pigpiod
</code></pre><p>『オコゲ』を実行するには、アプリケーションメニュー -&gt; プログラミング -&gt; ocoge で起動するか、ターミナルで ocoge と入力します。<br>基本的な使用方法は体験版やプチレッスンのページをご確認ください。</p><div class="card"><article class="blogcard"><h4 class="blogcard__heading"><a class="blogcard__link" href="/2022-05-07_demo/">『オコゲ』Web 体験版 | おこげ俱楽部</a></h4><img loading="lazy" class="blogcard__image" src="/assets/img/raspberrycake_ogp.webp"><p class="blogcard__description">ブロックプログラミングを体験してみましょう。ハードウェアなどの制限から、Web体験版ではできないこともありますが、感触を確かめることはできます。</p><div class="blogcard__meta"><img loading="lazy" class="blogcard__logo" src="/assets/img/favicon.png"><span class="blogcard__publisher">おこげ俱楽部</span></div></article></div><div class="card"><article class="blogcard"><h4 class="blogcard__heading"><a class="blogcard__link" href="/2022-05-14_petitlesson-01_typewriter-1/">プチレッスン『タイプライターっぽいもの』その1 | おこげ俱楽部</a></h4><img loading="lazy" class="blogcard__image" src="/assets/img/ogp_typewriter.webp"><p class="blogcard__description">サンプルプログラム「タイプライターもどき」をもうちょっとだけタイプライターっぽくしてみましょう。</p><div class="blogcard__meta"><img loading="lazy" class="blogcard__logo" src="/assets/img/favicon.png"><span class="blogcard__publisher">おこげ俱楽部</span></div></article></div><h2>制限・制約</h2><p>『オコゲ』の動作には開発者都合によるいくつかの制限・制約があります。これらに関して今後の変更・改善は予定されておりません。</p><h3>I2C, シリアル接続は同時に1つまで</h3><p><img loading="lazy" class="inline" src="/assets/img/block_serial_open.webp" style="height: 32px"> 及び <img loading="lazy" class="inline" src="/assets/img/block_i2c_open.webp" style="height: 32px"> のブロックは同時に1つの機器にしか接続できません。例えば、次のように</p><figure class="center"><img loading="lazy" src="/assets/img/block_i2c_twin.webp"><figcaption></figcaption></figure><p>のようなブロックを実行した場合、アドレス 1 のデバイスに接続する前にアドレス 0 のデバイスとは自動的に切断されます。</p><h3>センサー接続はそれぞれ同時に1つまで</h3><p>センサーブロックは種類ごとにそれそれ1つまで接続可能です。例えば</p><figure class="center"><img loading="lazy" src="/assets/img/block_i2c_mix.webp"><figcaption></figcaption></figure><p>は正常に動きますが、</p><figure class="center"><img loading="lazy" src="/assets/img/block_bme280_twin.webp"><figcaption></figcaption></figure><p>は、アドレス 0x76 の機器への接続は自動的に切断され、0x77 への接続だけが残ります。</p><h2>Tips</h2><h3>安全な無限ループ</h3><figure class="center"><img loading="lazy" src="/assets/img/block_infinit_loop.webp"><figcaption></figcaption></figure><p>上記のような無限ループを作って実行すると『オコゲ』が操作を受け付けなくなります(ウィンドウ右上の[X]ボタンで『オコゲ』アプリ自体を終了することはできます)。これを避けるには、<img loading="lazy" class="inline" src="/assets/img/block_wait_zero.webp" style="height: 32px"> を使って次のようにします。</p><figure class="center"><img loading="lazy" src="/assets/img/block_safe_loop.webp"><figcaption></figcaption></figure><p>このようにすることで、可能な限り早くループを回しつつ、ユーザ入力を受け付けるタイミングを確保することができます。</p><h3>I2C バスの変更</h3><p>Raspberry Pi のデフォルトの I2C バスGPIO2-3は内部で 1.8kΩ の抵抗によってプルアップされているため、プルアップ内蔵の I2C モジュールの一部が動作しない恐れがあります(<a href="https://akizukidenshi.com/catalog/faq/goodsfaq.aspx?goods=K-06795" target="_new" title=""><span style="color: gray; font-size: smaller;"><i class="fa-solid fa-arrow-up-right-from-square"></i></span> </a>)。<br>実際やってみると大抵はそのままで問題なく動くのですが、内部プルアップされていないピンに I2C を割り当てることで不具合をあらかじめ回避することもできます。当サイトではバスGPIO22-23を使用しています。</p><p>I2Cバスを有効化するには、/boot/config.txt に dtoverlay=i2c6,pins_22_23 を追記して再起動します。</p><pre><code class="language-bash">$ echo 'dtoverlay=i2c6,pins_22_23' | sudo tee -a /boot/config.txt
$ sudo reboot
</code></pre><p>※ I2C バスを使用する場合は、「Raspberry Pi の設定」や raspi-config で「I2C を有効」に設定してください。</p><p>●『オコゲ』の設定</p><p>ワークスペース画面でキーボードから「Shift+Ctrl+M」を入力すると、隠されていたメニューバーが表示されます。「Settings」-&gt; 「i2c bus」-&gt;「6」を選択し、I2C バスを変更します。</p><figure class="center"><img loading="lazy" src="/assets/img/i2c-settings.webp"><figcaption></figcaption></figure><p>もう一度「Shift+Ctrl+M」を入力するとメニューバーが隠れます。</p><h2>ソースコード</h2><p>ソースコードは <a href="https://git.ocoge.club/ocoge.club/ocoge" target="_new" title="">ocogIt <span style="color: gray; font-size: smaller;"><i class="fa-solid fa-arrow-up-right-from-square"></i></span> </a>で公開しています。</p></div><div class="mt-10"><div id="disqus_thread"></div><script>let disqusLoaded = false;
let disqus_config = function () {
this.page.url = 'https://ocoge.club/2022-06-13_ocoge-desktop/';
this.page.identifier = '2022-06-13_ocoge-desktop';
};
function loadComments() {
if (!disqusLoaded) {
disqusLoaded = true;
const d = document, s = d.createElement('script');
s.src = '//ocogeclub.disqus.com/embed.js';
(d.head || d.body).appendChild(s);
}
}
if(!!window.IntersectionObserver) {
const disqusEl = document.getElementById('disqus_thread');
const intersectionObserver = new IntersectionObserver(function(entries, observer) {
if (entries && entries[0] && entries[0].isIntersecting) {
loadComments();
observer.unobserve(disqusEl);
}
});
intersectionObserver.observe(disqusEl);
}</script></div></article></main><footer class="mt-20 px-10 py-8 bg-gray-200"><div id="footer-badge"><a href="https://git.ocoge.club/" target="_new"><img loading="lazy" src="/assets/img/git-ocogeclub.svg" class="footer-img"></a><a href="http://creativecommons.org/licenses/by-sa/4.0/deed.ja" target="_new"><img loading="lazy" src="/assets/img/License_BY-SA_4.0.svg" class="footer-img"></a></div><div class="max-w-5xl mx-auto text-gray-700 text-center">© 2024 <a href="/" class="font-medium" target="_blank" rel="noopener">おこげ俱楽部</a>. Made by <a href="https://ocoge.club" target="_blank" rel="noopener">ocogeclub</a> using <a href="https://www.11ty.dev" target="_blank" rel="noopener">Eleventy</a> and <a href="https://github.com/dafiulh/vredeburg" target="_blank" rel="noopener">Vredeburg</a>.<br></div></footer><script src="/assets/js/bundle.js"></script></body><script>window.addEventListener('load', (event) => {
</code></pre><p>※ I2C バスを使用する場合は、「Raspberry Pi の設定」や raspi-config で「I2C を有効」に設定してください。</p><p>●『オコゲ』の設定</p><p>ワークスペース画面でキーボードから「Shift+Ctrl+M」を入力すると、隠されていたメニューバーが表示されます。「Settings」-&gt; 「i2c bus」-&gt;「6」を選択し、I2C バスを変更します。</p><figure class="center"><img loading="lazy" src="/assets/img/i2c-settings.webp"><figcaption></figcaption></figure><p>もう一度「Shift+Ctrl+M」を入力するとメニューバーが隠れます。</p><h2>ソースコード</h2><p>ソースコードは <a href="https://git.ocoge.club/ocoge.club/ocoge" target="_new" title="">ocogIt <span style="color: gray; font-size: smaller;"><i class="fa-solid fa-arrow-up-right-from-square"></i></span> </a>で公開しています。</p></div></article></main><footer class="mt-20 px-10 py-8 bg-gray-200"><div id="footer-badge"><a href="https://git.ocoge.club/" target="_new"><img loading="lazy" src="/assets/img/git-ocogeclub.svg" class="footer-img"></a><a href="http://creativecommons.org/licenses/by-sa/4.0/deed.ja" target="_new"><img loading="lazy" src="/assets/img/License_BY-SA_4.0.svg" class="footer-img"></a></div><div class="max-w-5xl mx-auto text-gray-700 text-center">© 2024 <a href="/" class="font-medium" target="_blank" rel="noopener">おこげ俱楽部</a>. Made by <a href="https://ocoge.club" target="_blank" rel="noopener">ocogeclub</a> using <a href="https://www.11ty.dev" target="_blank" rel="noopener">Eleventy</a> and <a href="https://github.com/dafiulh/vredeburg" target="_blank" rel="noopener">Vredeburg</a>.<br></div></footer><script src="/assets/js/bundle.js"></script></body><script>window.addEventListener('load', (event) => {
document.getElementsByTagName('html')[0].style.display='block';
});</script></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -35,13 +35,6 @@
"description": "ちょっと楽しそうなハンドジェスチャセンサモジュール PAJ7620 を入手したので、『オコゲ』を使って遊んでみました。"
},
{
"url": "/2022-07-26_rp2040/",
"title": "海外からいろいろ届いたよ",
"date": "2022年7月26日",
"description": "RP2040 ベースのマイクロコントローラユニットをいくつか買ってみました。"
},
{
"url": "/2022-06-21_aqm0802a/",
"title": "AQM0802A に文字を表示してみる",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -10,9 +10,10 @@
<url><loc>https://ocoge.club/2022-05-16_tf-janken/</loc></url>
<url><loc>https://ocoge.club/2022-06-10_game-dentak/</loc></url>
<url><loc>https://ocoge.club/2022-06-21_aqm0802a/</loc></url>
<url><loc>https://ocoge.club/2022-07-26_rp2040/</loc></url>
<url><loc>https://ocoge.club/2022-08-03_paj7620/</loc></url>
<url><loc>https://ocoge.club/2023-03-22_server/</loc></url>
<url><loc>https://ocoge.club/2023-11-20_oled/</loc></url>
<url><loc>https://ocoge.club/2024-05-20_fingerprint/</loc></url>
<url><loc>https://ocoge.club/404.html</loc></url>
<url><loc>https://ocoge.club/about/</loc></url>
<url><loc>https://ocoge.club/</loc></url>
@ -21,8 +22,6 @@
<url><loc>https://ocoge.club/assets/floatbox/resources/configurator/</loc></url>
<url><loc>https://ocoge.club/assets/floatbox/resources/video/</loc></url>
<url><loc>https://ocoge.club/img/</loc></url>
<url><loc>https://ocoge.club/2023-11-20_oled/</loc></url>
<url><loc>https://ocoge.club/2024-05-20_fingerprint/</loc></url>
<url><loc>https://ocoge.club/ict-course-portal/</loc></url>
</urlset>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,127 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>おこげ俱楽部 - Ohiwa Code Generator - Portal</title>
<meta name="title" content="おこげ俱楽部 - Ohiwa Code Generator - Portal">
<meta name="description" content="Ohiwa Code Generator - Portal">
<meta name="keywords" content="オコゲ,デスクトップアプリ版,オコゲ,blockly,プログラミング,上野学習塾">
<meta name="author" content="ocogeclub">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://ocoge.club/template copy/">
<link rel="shortcut icon" type="image/png" href="/assets/img/favicon.png">
<link rel="apple-touch-icon" href="/assets/img/apple-touch-icon.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Kosugi+Maru&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap">
<script src="https://kit.fontawesome.com/73f7be0650.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="/assets/floatbox/floatbox.css" />
<script src="/assets/floatbox/floatbox.js" defer></script>
<link rel="stylesheet" href="/assets/css/ocmain.css">
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="stylesheet" href="/assets/css/footer.css">
<link rel="stylesheet" href="/assets/css/post.css">
<meta property="og:image" content="https://ocoge.club/assets/img/.webp">
<meta property="og:title" content="おこげ俱楽部 - Ohiwa Code Generator - Portal">
<meta property="og:description" content="Ohiwa Code Generator - Portal">
<meta property="og:url" content="https://ocoge.club/template copy/">
<meta property="og:site_name" content="おこげ俱楽部">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@ocogeclub">
</head>
<body class="flex flex-col h-screen bg-white text-gray-800 break-words">
<header id="header" class="header-shadow bg-white px-6 py-5 z-50 fixed w-full top-0 transition-all transform ease-in-out duration-500">
<div class="max-w-5xl mx-auto flex items-center flex-wrap justify-between">
<div class="sm:mr-8">
<a class="flex items-center" href="/">
<span class="text-xl text-teal-700 font-semibold self-center"><img src="/assets/img/ocoge_title_kogecha.webp" title="おこげ俱楽部" alt="おこげ俱楽部" id="site_title"></span>
</a>
</div>
<nav id="menu" class="order-last md:order-none items-center flex-grow w-full md:w-auto md:flex hidden mt-2 md:mt-0">
<a href="/about" class="block mt-4 md:inline-block md:mt-0 font-medium text-gray-700 hover:text-teal-600 text-base mr-4">About</a>
<a href="/tags" class="block mt-4 md:inline-block md:mt-0 font-medium text-gray-700 hover:text-teal-600 text-base mr-4">Tag List</a>
<a href="https://cloud.ocoge.club/" target="_blank" rel="noopener" class="block mt-4 md:inline-block md:mt-0 font-medium text-gray-700 hover:text-teal-600 text-base mr-4">Cloud</a>
<a href="https://mail.ocoge.club/" target="_blank" rel="noopener" class="block mt-4 md:inline-block md:mt-0 font-medium text-gray-700 hover:text-teal-600 text-base mr-4">Mail</a>
<a href="https://git.ocoge.club/ocogeclub/pages" target="_blank" rel="noopener" class="block mt-4 md:inline-block md:mt-0 font-medium text-gray-700 hover:text-teal-600 text-base mr-4">ocogIt</a>
</nav>
<form id="search" action="/search" class="order-last sm:order-none flex-grow items-center justify-end hidden sm:block mt-6 sm:mt-0">
<label class="visually-hidden" for="header-searchbox">記事タイトル/概要を検索 ...</label>
<input type="text" id="header-searchbox" name="q" placeholder="記事タイトル/概要を検索 ..." class="w-full sm:max-w-xs bg-gray-200 border border-transparent float-right focus:bg-white focus:border-gray-300 focus:outline-none h-8 p-4 placeholder-gray-500 rounded text-gray-700 text-sm">
</form>
<div id="menu-toggle" class="flex items-center md:hidden text-gray-700 hover:text-teal-600 cursor-pointer sm:ml-6">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</div>
</div>
</header>
<main class="mx-7 lg:mx-6 mt-32 flex-grow">
<article class="max-w-5xl mx-auto">
<header class="mb-14">
<h1 class="text-3xl text-center font-bold leading-normal text-gray-900 mt-0 mb-3"></h1>
<div class="text-center"><i class="fa-regular fa-clock"></i> 2024年5月19日</div>
<div class="mt-3 text-center">
<a href="/tags/オコゲ" class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-medium text-gray-700 m-0.5">#オコゲ</a>
<a href="/tags/デスクトップアプリ版" class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-medium text-gray-700 m-0.5">#デスクトップアプリ版</a>
</div>
<div class="mt-10 -mx-7 md:mx-0">
<img class="w-full max-w-2xl mx-auto" src="/assets/img/.webp" alt="This post thumbnail">
</div>
</header>
<div id="content" class="prose text-gray-800 max-w-none">
<div class="box_stripe"><p></p></div>
</div>
<div class="mt-10">
<div class="italic text-gray-700">Disqus comments only available for production</div>
</div>
</article>
</main>
<footer class="mt-20 px-10 py-8 bg-gray-200">
<div id="footer-badge"><a href="https://git.ocoge.club/" target=_new><img loading="lazy" src="/assets/img/git-ocogeclub.svg" class="footer-img"></a><a href="http://creativecommons.org/licenses/by-sa/4.0/deed.ja" target=_new><img loading="lazy" src="/assets/img/License_BY-SA_4.0.svg" class="footer-img"></a></div>
<div class="max-w-5xl mx-auto text-gray-700 text-center">
© 2024 <a href="/" class="font-medium" target="_blank" rel="noopener">おこげ俱楽部</a>.
Made by <a href="https://ocoge.club" target="_blank" rel="noopener">ocogeclub</a>
using <a href="https://www.11ty.dev" target="_blank" rel="noopener">Eleventy</a> and <a href="https://github.com/dafiulh/vredeburg" target="_blank" rel="noopener">Vredeburg</a>.<br>
</div>
</footer>
<script src="/assets/js/bundle.js"></script>
</body>
<script>
window.addEventListener('load', (event) => {
document.getElementsByTagName('html')[0].style.display='block';
});
</script>
</html>

File diff suppressed because one or more lines are too long

View File

@ -7,5 +7,5 @@ module.exports = {
// how many posts you want to show for each page
paginate: 6,
// if you want to add disqus to your site
disqusShortname: "ocogeclub"
// disqusShortname: "ocogeclub"
};

View File

@ -1,4 +1,5 @@
---
eleventyExcludeFromCollections: true
title: "海外からいろいろ届いたよ"
description: "RP2040 ベースのマイクロコントローラユニットをいくつか買ってみました。"
date: 2022-07-26

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB