{"id":19,"date":"2025-06-06T06:53:13","date_gmt":"2025-06-06T06:53:13","guid":{"rendered":"https:\/\/sinem.i24.flexvakken.nl\/?page_id=19"},"modified":"2025-06-06T06:53:13","modified_gmt":"2025-06-06T06:53:13","slug":"schuifpotentiometer","status":"publish","type":"page","link":"https:\/\/sinem.i24.flexvakken.nl\/?page_id=19","title":{"rendered":"Schuifpotentiometer"},"content":{"rendered":"<p>dit is de code voor een schuifpotentiometer.<\/p>\n<p>&nbsp;<\/p>\n<div data-olk-copy-source=\"MessageBody\">\/\/ Definieer pinnen<br \/>\nconst int potPin = A0; \/\/ Pin voor de potentiometer<br \/>\nconst int led1Pin = 7; \/\/ Pin voor de eerste LED<br \/>\nconst int led2Pin = 10; \/\/ Pin voor de tweede LED<\/div>\n<div>int potValue = 0; \/\/ variabele om de potentiometerwaarde op te slaan<\/div>\n<div>void setup() {<br \/>\n\/\/ Stel LED-pinnen in als uitvoer<br \/>\npinMode(led1Pin, OUTPUT);<br \/>\npinMode(led2Pin, OUTPUT);<\/div>\n<div>\/\/ Start seri\u00eble communicatie<br \/>\nSerial.begin(9600);<\/div>\n<div>}<\/div>\n<div>void loop() {<br \/>\n\/\/ Lees de waarde van de potentiometer (0 tot 1023)<br \/>\npotValue = analogRead(potPin);<\/div>\n<div>\/\/ Schrijf de waarde naar de seri\u00eble monitor<br \/>\nSerial.print(\u201cPotentiometerwaarde: \u201c) ;<br \/>\nSerial.println(potValue);<\/div>\n<div>\/\/ Regels voor LED 1 (brand bij lage waarden)<br \/>\nif (potValue &lt; 400) {<br \/>\ndigitalWrite(led1Pin, HIGH); \/\/ LED 1 aan<br \/>\ndigitalWrite(led2Pin, LOW); \/\/ LED 2 uit<br \/>\n}<br \/>\n\/\/ Regels voor LED 2 (brand bij hoge waarde)<br \/>\nelse if (potValue &lt; 600) {<br \/>\ndigitalWrite(led1Pin, LOW); \/\/ LED 1 uit<br \/>\ndigitalWrite(led2Pin, HIGH); \/\/ LED 2 aan<br \/>\n}<br \/>\n\/\/ Beide LED\u2019s uit als waarde tussen 400 en 600 ligt<br \/>\nelse {<br \/>\ndigitalWrite(led1Pin, LOW); \/\/ LED 1 uit<br \/>\ndigitalWrite(led2Pin, LOW); \/\/ LED 2 uit<br \/>\n}<\/div>\n<div>\/\/ Wacht even voordat de volgende waarde wordt gelezen<br \/>\ndelay(100);<\/div>\n<div><\/div>\n<div><img decoding=\"async\" class=\"alignnone wp-image-16\" src=\"https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/arduino-chip-300x300.webp\" alt=\"\" width=\"193\" height=\"193\" srcset=\"https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/arduino-chip-300x300.webp 300w, https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/arduino-chip-1024x1024.webp 1024w, https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/arduino-chip-150x150.webp 150w, https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/arduino-chip-768x768.webp 768w, https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/arduino-chip.webp 1500w\" sizes=\"(max-width: 193px) 100vw, 193px\" \/><\/div>\n<div>Dat is de chip die gaat progammeren zodat alles het goed doet. je verbind de chip hierna aan je laptop en je volgt de instructie van de code en voert hem in die je nodig hebt om de schuifpotentiometer te laten werken.<\/div>\n<div><\/div>\n<div><img decoding=\"async\" class=\"alignnone  wp-image-20\" src=\"https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/schuifpotentiometer-300x238.jpg\" alt=\"\" width=\"212\" height=\"168\" srcset=\"https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/schuifpotentiometer-300x238.jpg 300w, https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/schuifpotentiometer.jpg 550w\" sizes=\"(max-width: 212px) 100vw, 212px\" \/><\/div>\n<div>dit is de schuifpotentiometer.<\/div>\n<div><\/div>\n<div><img decoding=\"async\" class=\"alignnone  wp-image-17\" src=\"https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/verkeerslicht-arduino-300x193.png\" alt=\"\" width=\"207\" height=\"133\" srcset=\"https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/verkeerslicht-arduino-300x193.png 300w, https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/verkeerslicht-arduino-1024x659.png 1024w, https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/verkeerslicht-arduino-768x494.png 768w, https:\/\/sinem.i24.flexvakken.nl\/wp-content\/uploads\/2025\/06\/verkeerslicht-arduino.png 1236w\" sizes=\"(max-width: 207px) 100vw, 207px\" \/><\/div>\n<div>zo moet je de schuifpotentiometer aansluiten op de chip.<\/div>\n<div><\/div>\n<div>wat heb je nodig?<\/div>\n<div>-schuifpotentiometer<\/div>\n<div>-stroomkabels<\/div>\n<div>-arduino chip.<\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>dit is de code voor een schuifpotentiometer. &nbsp; \/\/ Definieer pinnen const int potPin = A0; \/\/ Pin voor de potentiometer const int led1Pin = 7; \/\/ Pin voor de eerste LED const int led2Pin = 10; \/\/ Pin voor de tweede LED int potValue = 0; \/\/ variabele om de potentiometerwaarde op te slaan [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-19","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sinem.i24.flexvakken.nl\/index.php?rest_route=\/wp\/v2\/pages\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sinem.i24.flexvakken.nl\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sinem.i24.flexvakken.nl\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sinem.i24.flexvakken.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sinem.i24.flexvakken.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":1,"href":"https:\/\/sinem.i24.flexvakken.nl\/index.php?rest_route=\/wp\/v2\/pages\/19\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/sinem.i24.flexvakken.nl\/index.php?rest_route=\/wp\/v2\/pages\/19\/revisions\/21"}],"wp:attachment":[{"href":"https:\/\/sinem.i24.flexvakken.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}