[{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eHi. today i`m going to show you how to use the GPIO or pins on Arduino it doesn't matter witch one as long as it has GPIO.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eFirst jumper weirs:\u0026nbsp; \u0026nbsp; \u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/825","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eNext you need a device to code with:\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eAnd you need a Arduino:\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/4806","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eNow you need a sensor any: motion, light and distance. Also a led(NOT high powered,\u0026nbsp;\u003cem\u003e! warning if you put the led in the wrong direction it may break the led or your board\u003c/em\u003e ) Put led in with the long side in positive and the short in negative:\u0026nbsp;\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/297","metadata":{}},{"element_type":"product","content":"https://www.adafruit.com/product/189","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n        \u003cp\u003e\u003cspan\u003eSetup:\u0026nbsp;\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eSo now when you have all of the required materials set them down on your table and\u0026nbsp; make sure to know which sensor you chose. Next switch to your Arduino and find the GND pin and 5v or 3v pin. If you have a motion sensor plug the vcc into five volts pin\u003cem\u003e: note, that is a GPIO.\u003c/em\u003e while plunging these in you will be using the jumper wires. Now apply the GND pin to the GND pin on the board. Great now you have given power to your sensor. now the only pin open should be the signal pin. They say different things depending on the brand so i cant really say the name. So connect that pin on the sensor to pin 2 on the board:\u0026nbsp;\u003cem\u003enote that is a GPIO.\u003c/em\u003e Now I'll explain the light sensor. The average light sensor has two pins. I won`t go into detail of what the sensor does, but i might do it in the future, So connect the power pin of the sensor two 5v or 3v, 5v recommended. now connect the other end into pin 2: \u003cem\u003enote this is a GPIO.\u003c/em\u003e now you have finished setting the sensor.\u0026nbsp;\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eLED setup:\u0026nbsp;\u003c/p\u003e\n\u003cp\u003enow grab your led and connect the long end into pin 4\u003cem\u003e: note another GPIO. \u003c/em\u003eNow finally connect the short end into GND on your board.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eHooray you made it to the last step... The code.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI`m using c++ if you don`t have a c++ editor here is a link to a code converter \u003ca title=\"c++ to Python\" href=\"https://www.codeconvert.ai/c++-to-python-converter\" target=\"_blank\"\u003ehttps://www.codeconvert.ai/c++-to-python-converter\u0026nbsp;\u003c/a\u003e\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"/*  \n    Arduino with PIR motion sensor or light sensor\n   for viewers\n    Modified by @delucas based on PIR sensor or light sensor\n    simplified with no reading values\n*/\n \nint led = 4;                // led variable\nint sensor = 2;              // sensor variable - middle out pin in sensor\n\nvoid setup() {\n  pinMode(led, OUTPUT);      //  LED as is an output\n  pinMode(sensor, INPUT);    //  sensor is as an input\n  Serial.begin(9600);        // initialize serial\n}\n\nvoid loop(){\n  if (sensor == HIGH) {           // check if the sensor is HIGH\n  digitalWrite(led, HIGH);   // turn LED ON\n    Serial.println(\"Motion sensed!\");\n  delay(100);                // delay 100 milliseconds \n  digitalWrite(led, LOW); // turn LED OFF\n   delay(200);             // delay 200 milliseconds \n       \n    }\n  }","metadata":{"language":"auto","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eAny problems with the code please tell me.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"button","content":"https://github.com/delucasd2/delucasd2/commit/67942b0cc6ce9241541261c55411b02f1f777c19","metadata":{"class":"btn btn-large btn-block btn-primary","button_type":"primary","target":"_self","zip_folder":"false"}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eThank you for participating in this!\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n        \u003cp\u003ehere is the wire setup:\u003c/p\u003e\n      \n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/871/original/Screenshot_2024-05-01_15.53.17.png?1714595980","metadata":{"caption":""}}]