3D CAD をやってみて、やはりプログラミングを先にいろいろやっていて良かったと感じる。仕事で「プログラミングできて良かった」と思うことは極めて稀だが、趣味でいろんなことをしてみると全く「プログラミングをできて良かった」と思うことが多い。拘束とは制約プログラミングだと気付ければ難しいことが一切なくなり、便利さだけが理解できる。
街には「地域ぐるみでなくそう路上喫煙」とか旗が立ってたりするが、喫煙者はすぐそばで路上喫煙をする。彼らは文字が読めないので仕方がない。対応策が間違っているのだ。喫煙者はなぜか人間として扱われているが、識字率99%以上のこの国で文字が読めないので、初等教育も受けていないことは明白であり、人間のような姿に見える他の生物である。JT とかいう独占企業があってモラルを啓蒙して「おれは悪くない」アピールをしているが、そもそも人間ではない生物にはモラルなどなく、判断能力のないそれに、中毒症状をいいことに薬物を売りつけるのが JT であって、今すぐにでも滅びなければならない。
Beagle Bone Black は TI の ARM SoC である AM3359AZCZ100 がメインCPUの、Raspberry Pi に似たカードサイズ Linux コンピュータです。GPIO が豊富にあり、これに Machinekit をインストールすることで、単体でCNCコントローラにできます。
パラレルポートに依存した環境構築というのは今時ちょっとやる気が起きませんし、パラレルポートが増設可能なフル装備の Linux コンピュータを組み立てようと思うと結構コストがかかります。Beagle Bone だと単体で役目を果たすことができます。
Raspberry Pi ではダメなのか? という疑問があるかと思いますが、実は BBB にあって Raspberry Pi にはない重要な機能があります。それが PRU (Programmable Real-time Unit) です。
Switching Boot Modes The initial boot mode is set by PSKEY_INITIAL_BOOTMODE. If this PS Key is set to 2 (HID proxy mode), CSR8510 A10 enumerates as USB HID device.
When the PC boots with its operating system and Bluetooth host stack, the Bluetooth host stack may reboot the CSR8510 A10 in mode 0 (standard HCI operation). In this mode, the Bluetooth Host Stack handles the HID device functions.
Note: Switching from HID to HCI is allowed in both HID Boot Protocol Mode and HID Report Protocol Mode configuration. In HID Report Protocol Mode, the USB report descriptors should include the feature report to accept the USB Set Feature request to accept the command from the host.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Devices.HumanInterfaceDevice;
using Windows.Devices.Enumeration;
// WindowsRuntimeSystemExtensions could not be found
// using WindowsRuntimeSystemExtensions.AsTask;
namespace Foo
{
class Program
{
const UInt16 USAGE_PAGE = 0x01; // Generic Desktop Ctrls
const UInt16 USAGE_ID = 0x06; // Keyboard
static void Main(string[] args)
{
Task.Factory.StartNew(async () =>
{
await new Program().run();
})
.Unwrap()
.Wait();
}
private async Task run()
{
var selector = HidDevice.GetDeviceSelector(USAGE_PAGE, USAGE_ID);
var devices = await DeviceInformation.FindAllAsync(selector);
Console.WriteLine("%s", devices);
}
}
}
Could not install package 'System.Runtime.WindowsRuntime 4.0.11'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
========== Finished ==========