C++ 直接访问连线

标签 c++ led

<分区>

我想创建一个为电缆供电的 C++ 程序。就像以太网电缆中有几根电线一样。我如何选择电线并通过它发送电流? 如果有人能解释如何通过特定的电线发送电流,那就太好了。我也不想使用图书馆。为了让它更清楚,我希望能够做这样的事情 [视频] https://www.youtube.com/watch?v=H1enhkLZm10 .

最佳答案

我想这会回答您的问题:I/O Ports controlled LEDs .

这是网站上关于如何与端口通信的代码片段:

#include <conio.h>
#include <dos.h> // For _out
#define port 0x378 // Port Address
#define data port+0 // Data Port of the parallel cable
void main (void)
{
  _out(data, 255); // For all lights on
  _out(data, 0); // For all lights off
}

如果您不知道计算机如何与外围设备通信,以及 USB(通用串行总线)、串行端口和其他端口等不同端口如何通信和工作。本指南应该可以帮助您入门。 Control Physical World Through Computer (Step by Step)

关于C++ 直接访问连线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33900636/

相关文章:

C++ 不同的错误使用不同的 gcc 优化

c++ - OpenCV idft() 和 MATLAB ifft2 的结果不匹配

c - 使用串行端口从 C 程序打开或关闭 LED 的步骤?

java - Android - 在 Android 中用按钮控制 LED

c++ - 将以毫秒为单位的 Unix 时间戳转换为正常日期

c++ - OpenGL 绘制有很多缺失的面孔

Arduino 开发板 : difference between two gnd port

android - LED闪光灯激活

MATLAB 将 LED 连接到串行端口

c++ - 未定义对 'cudaRegisterLinkedBinary'的引用-CMake中的链接错误?