Project Two - Digital Input v1.0b
Introduction
The purpose of this project is to demonstrate two forms of digital input – using the button Grove and the tilt switch Grove . Pressing the button will light the LED, and activating the tilt-switch will light the LED.
Wiring it:
- Connect the LED Module to the D1/D2 Digital I/O jack, like it was in Projects 1.
- Arduino Pin D1 powers the LED on the Grove’s SIG connector, and Arduino Pin D2 connect to the LED Grove’s NC connector.
- Connect the Tilt Switch Grove to the D5/D6 Digital I/O jack.
- The Tilt Switch Grove’s SIG connector sends a high or low signal to the Arduino’s D5 digital input.
- Connect the Button Module to the D7/D8 input jack (on the second row.)
- The Button Grove uses the SIG connector to send a signal to the Arduino’s D7 digital input.
Now upload the following Arduino sketch:
// Project Two - Digital Inputs
//
void setup()
{
pinMode(1, OUTPUT);
pinMode(5, INPUT);
pinMode(7, INPUT);
}
void loop()
{
if (digitalRead(5)==HIGH)
{
digitalWrite(1, HIGH);
delay(100);
digitalWrite(1, LOW);
}
if (digitalRead(7)==HIGH)
{
digitalWrite(1, HIGH);
delay(200);
digitalWrite(1, LOW);
}
}
Help us make it better
Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:
- Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
- Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
- Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.
An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.
Happy hacking
댓글 없음:
댓글 쓰기