Skip to content

Commit

Permalink
change some need library projects
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemeiping committed Aug 17, 2023
1 parent 0bb7b9f commit 1114cff
Show file tree
Hide file tree
Showing 109 changed files with 484 additions and 443 deletions.
6 changes: 3 additions & 3 deletions docs/source/arduino/1.10_state_change_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Code
.. note::

* You can open the file ``1.10_stateChangeDetection.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.10_stateChangeDetection`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.




.. raw:: html
Expand Down
4 changes: 2 additions & 2 deletions docs/source/arduino/1.11_interval.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ Code

* You can open the file ``1.11_interval.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.11_interval`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.




.. raw:: html
Expand Down
5 changes: 3 additions & 2 deletions docs/source/arduino/1.1_get_start.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.. _get_started_ar:

1.1 Get Started with Arduino IDE
=======================================
Expand All @@ -16,7 +17,7 @@ Please follow the tutorial below to learn how to install the Arduino IDE, add li
:maxdepth: 1

arduino_start/install_arduino_ide
arduino_start/download_add
arduino_start/upload_code
arduino_start/introduce_ide
arduino_start/add_libraries_ar


4 changes: 1 addition & 3 deletions docs/source/arduino/1.2_digital_write.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ codes.
.. note::

* You can open the file ``1.2_digitalWrite.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.2_digitalWrite`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.

.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/1.3_analog_write.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Code
.. note::

* You can open the file ``1.3_analogWrite.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.3_analogWrite`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/1.4_digital_read.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Code
.. note::

* You can open the file ``1.4_digitalRead.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.4_digitalRead`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.




.. raw:: html
Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/1.5_analog_read.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Code
.. note::

* You can open the file ``1.5_analogRead.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.5_analogRead`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.




.. raw:: html
Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/1.6_digital_input_control_output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ Code
.. note::

* You can open the file ``1.6_digitalInputControlOutput.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.6_digitalInputControlOutput`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.




.. raw:: html
Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/1.7_analog_input_control_output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Code
.. note::

* You can open the file ``1.7_analogInputControlOutput.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.7_analogInputControlOutput`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.





Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/1.8_serial_read.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Code
.. note::

* You can open the file ``1.8_serialRead.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.8_serialRead`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.




.. raw:: html
Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/1.9_digital_input_pull-up.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Code
.. note::

* You can open the file ``1.9_digitalInputPullup.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\1.9_digitalInputPullup`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.




.. raw:: html
Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.10_active_buzzer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Code
.. note::

* You can open the file ``2.10_activeBuzzer.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.10_activeBuzzer`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.11_passive_buzzer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Code
.. note::

* You can open the file ``2.11_passiveBuzzer.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.11_passiveBuzzer`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.12_servo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Code
.. note::

* You can open the file ``2.12_servo.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.12_servo`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.13_motor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Code
.. note::

* You can open the file ``2.13_motor.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.13_motor`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.14_stepper_motor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Code
.. note::

* You can open the file ``2.14_stepperMotor.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.14_stepperMotor`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
12 changes: 6 additions & 6 deletions docs/source/arduino/2.15_button.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Code
.. note::

* You can open the file ``2.15_button.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.15_button`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand All @@ -72,9 +72,9 @@ will display「0」. As for the detail code explanation, please refer to :ref:`a
.. note::

* You can open the file ``2.15_button_2.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.15_button_2`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.16_slide_switch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Code
.. note::

* You can open the file ``2.16_switch.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.16_switch`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.17_tilt_switch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Code
.. note::

* You can open the file ``2.17_tiltSwitch.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.17_tiltSwitch`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.18_touch_switch_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Code
.. note::

* You can open the file ``2.18_touchSwitch.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.18_touchSwitch`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down
7 changes: 4 additions & 3 deletions docs/source/arduino/2.19_keypad.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ Code
.. note::

* You can open the file ``2.19_keypad.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.19_keypad`` directly.
* Or copy this code into Arduino IDE 1/2.
* Then :ref:`ar_upload_code` to the board.
* Please make sure you have added the library called ``Keypad``, detailed tutorials refer to :ref:`add_libraries_ar`.
* The ``Keypad`` library is used here, you can install it from the **Library Manager**.

.. image:: img/lib_keypad.png
:align: center

.. raw:: html

Expand Down
72 changes: 36 additions & 36 deletions docs/source/arduino/2.20_ir_receiver_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Code
.. note::

* You can open the file ``2.20_irReceiver.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.20_irReceiver`` directly.
* Or copy this code into Arduino IDE 1/2.
* Then :ref:`ar_upload_code` to the board.
* Please make sure you have added the library called ``IRremote``, detailed tutorials refer to :ref:`add_libraries_ar`.
* The ``IRremote`` library is used here, you can install it from the **Library Manager**.

.. image:: img/lib_irremote.png
:align: center

.. raw:: html

Expand All @@ -60,52 +60,52 @@ the serial monitor.
Code Analysis
---------------------

There are two important parts to notice in this program.
This code is designed to work with an infrared (IR) remote control using the ``IRremote`` library. Here's the breakdown:

1. The code uses an extra file decodeKeyValue.ino to decode the values in
class decode_result into key value.The file will be opened together with
the main file.
#. Include Libraries: This includes the IRremote library, which provides functions to work with IR remote controls.

2. IR Remote function is achieved by calling IRremote.h library related
functions.
.. code-block:: arduino
.. code-block:: arduino
#include <IRremote.h>
#include <IRremote.h>
#. Defines the Arduino pin to which the IR sensor's signal pin is connected and declares a variable to store the last decoded IR value.

**Library Functions:**
.. code-block:: arduino
.. code-block:: arduino
const int IR_RECEIVE_PIN = 11; // Define the pin number for the IR Sensor
String lastDecodedValue = ""; // Variable to store the last decoded value
IRrecv(int recvpin)
#. Initializes serial communication at a baud rate of 9600. Initializes the IR receiver on the specified pin (``IR_RECEIVE_PIN``) and enables LED feedback (if applicable).

Create IRrecv object to control a IR Receiver module.
.. code-block:: arduino
.. code-block:: arduino
void setup() {
Serial.begin(9600); // Start serial communication at 9600 baud rate
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK); // Start the IR receiver
}
decode_result
#. The loop runs continuously to process incoming IR remote signals.

In this kit, results are usually 8-digit hexadecimal numbers starting
with 00FF. You can check decodeKeyValue.ino file in the sample file.
.. code-block:: arduino
.. code-block:: arduino
void loop() {
if (IrReceiver.decode()) {
String decodedValue = decodeKeyValue(IrReceiver.decodedIRData.command);
if (decodedValue != "ERROR" && decodedValue != lastDecodedValue) {
Serial.println(decodedValue);
lastDecodedValue = decodedValue; // Update the last decoded value
}
IrReceiver.resume(); // Enable receiving of the next value
}
}
* Checks if an IR signal is received and successfully decoded.
* Decodes the IR command and stores it in ``decodedValue`` using a custom ``decodeKeyValue()`` function.
* Checks if the decoded value is not an error and is different from the last decoded value.
* Prints the decoded IR value to the serial monitor.
* Updates the ``lastDecodedValue`` with the new decoded value.
* Resumes IR signal reception for the next signal.

void enableIRIn()
Initialize the IR receiver module.

.. code-block:: arduino
int decode(decode_results *results);
Decodes the received IR message. Returns 0 if no data ready, 1 if data
ready. Results of decoding are stored in results.

.. code-block:: arduino
void resume()
Restart for receiving an other value.

Phenomenon Picture
------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/source/arduino/2.21_relay_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ Code
.. note::

* You can open the file ``2.21_relayModule.ino`` under the path of ``sunfounder_vincent_kit_for_arduino\code\2.21_relayModule`` directly.
* Or copy this code into Arduino IDE 1/2.
* Or click **Open Code** to open it in `Web Editor <https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor>`_.
* Then :ref:`ar_upload_code` to the board.
* Or copy this code into Arduino IDE.



.. raw:: html

Expand Down

0 comments on commit 1114cff

Please sign in to comment.