Noduino Digital Pin
来自Jack's Lab
(版本间的差异)
(以“== Overview == * pinMode() * digitalWrite() * digitalRead() <br><br> == Examples == <source lang=cpp> #include "noduino.h" void setup() { pinMode(D5, OUTPUT); ...”为内容创建页面) |
(→Examples) |
||
| 第8行: | 第8行: | ||
== Examples == | == Examples == | ||
| + | |||
| + | Use the pin D5 to output a square wave: | ||
<source lang=cpp> | <source lang=cpp> | ||
| 第21行: | 第23行: | ||
{ | { | ||
digitalWrite(D5, HIGH); // ouput high level | digitalWrite(D5, HIGH); // ouput high level | ||
| − | delay(1000); | + | delay(1000); // delay 1000ms |
| − | digitalWrite(D5, LOW); | + | digitalWrite(D5, LOW); // output low level |
| − | delay(1000); | + | delay(1000); |
} | } | ||
</source> | </source> | ||
2016年8月28日 (日) 08:44的版本
1 Overview
- pinMode()
- digitalWrite()
- digitalRead()
2 Examples
Use the pin D5 to output a square wave:
#include "noduino.h"
void setup()
{
pinMode(D5, OUTPUT); // set D5 to output mode
digitalWrite(D5, LOW);
}
void loop()
{
digitalWrite(D5, HIGH); // ouput high level
delay(1000); // delay 1000ms
digitalWrite(D5, LOW); // output low level
delay(1000);
}