Code With Conner
Code With Conner
  • 65
  • 102 700
Lets Learn Java - Loops
Welcome back to Let's Learn Java. In this lesson we'll be coving Loops.
Specifically, we'll discuss:
- for loops
- nested for loops
- while loops
- do while loops
My Links:
- CodeWithConner: www.codewithconner.ca/
Purchase Code With Conner Teaching resources at any of the stores below:
- www.teacherspayteachers.com/Store/Code-With-Conner
- bit.ly/3ifyNqV
- www.tes.com/teaching-resources/shop/ancnnr
0:00 - Introduction
0:20 - for loops
1:22 - nested for loops
2:15 - while loops
4:35 - do while loops
มุมมอง: 80

วีดีโอ

Lets Learn Java - Strings
มุมมอง 512 ปีที่แล้ว
Welcome back to Let's Learn Java. In this lesson we'll be coving Strings and some basic String methods Specifically, we'll discuss: - String initialization - String indexing - Looping through strings - length - substrings - charAt My Links: - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below: - www.teacherspayteachers.com/Store/Code-W...
Expanding and Factoring Polynomials
มุมมอง 892 ปีที่แล้ว
Quick video showing examples of expanding and factoring polynomial expressions using the area model, distributive model, and factor by grouping.
Let's Learn Java - Searching and Sorting Algorithms
มุมมอง 1.5K3 ปีที่แล้ว
Welcome back to Let's Learn Java. In this lesson we'll be coving searching & sorting algorithms. Specifically, we'll discuss: - Linear/Sequential Search - Binary Search - Selection Sort - Insertion Sort - Merge Sort Searching/Sorting Linear Search: www.geeksforgeeks.org/linear-search/ Binary Search: www.geeksforgeeks.org/binary-search/ Selection Sort: www.geeksforgeeks.org/selection-sort/ Inser...
Let's Learn Java - Recursion
มุมมอง 2343 ปีที่แล้ว
This video lesson will cover the topic of Recursion in Java. Code example from lesson: bit.ly/3esTxvw Links: - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below: - www.teacherspayteachers.com/Store/Code-With-Conner - bit.ly/3ifyNqV - www.tes.com/teaching-resources/shop/ancnnr
Let's Learn Python - Final Course Project
มุมมอง 1913 ปีที่แล้ว
You made it! This is the end of course project for the Let's Learn Python course. I'll lay out a few options and play through some examples (links below). Give it your best effort and hit me up in the comments with questions and hopefully to share what you made! Good luck and thanks so much for coming on this journey with me :) Hangman: codehs.com/sandbox/id/hangman-wwjZyW/run Rock Paper Scisso...
Let's Learn Python - Unit 5 Project
มุมมอง 1463 ปีที่แล้ว
This is the Unit 5 project for the Let's Learn Python course. We'll learn more about python by making a Choose Your Own Adventure Game! Watch for details :) Play the game from the video: A Kingdom Lost here: codehs.com/sandbox/id/the_caverns-d0dk2E/run (Author: Madi Armstrong) Links: - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below...
Let's Learn Python - Dictionaries - Unit 5 Topic 4
มุมมอง 2753 ปีที่แล้ว
Unit 5 Topic 4 - Let's Learn Python In this lesson we'll learn about dictionaries in python! This is the last lesson of this introduction to python course :) Links: - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below: - www.teacherspayteachers.com/Store/Code-With-Conner - bit.ly/3ifyNqV - www.tes.com/teaching-resources/shop/ancnnr 0:0...
Let's Learn Python - 2D Lists - Unit 5 Topic 3
มุมมอง 3703 ปีที่แล้ว
Welcome to Unit 5 Topic 3 of Let's Learn Python. In this video we'll learn about 2-Dimensional Lists. This will also introduce a challenge to create a Maze game! Links: - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below: - www.teacherspayteachers.com/Store/Code-With-Conner - bit.ly/3ifyNqV - www.tes.com/teaching-resources/shop/ancnnr
Let's Learn Python - Lists - Unit 5 Topic 2
มุมมอง 2293 ปีที่แล้ว
Welcome to Unit 5 Topic 2 of Let's Learn Python. In this video we will learn about Lists which are the primary data structure you'll use in Python. Challenge: Madlibs with lists. Links: - CodeWithConner: www.codewithconner.ca/ - www.w3schools.com/python/python_ref_list.asp Purchase Code With Conner Teaching resources at any of the stores below: - www.teacherspayteachers.com/Store/Code-With-Conn...
Let's Learn Python - Tuples - Unit 5 Topic 1
มุมมอง 2413 ปีที่แล้ว
This is Unit 5 - Topic 1 of Let's Learn Python and in this lesson we're going to learn TUPLES in python and also we'll be discussing what data structures are in a more general sense. Links: - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below: - www.teacherspayteachers.com/Store/Code-With-Conner - bit.ly/3ifyNqV - www.tes.com/teaching-...
Let's Learn Python - Project Time - Unit 4
มุมมอง 2263 ปีที่แล้ว
This is the unit 4 project from Let's Learn Python. This project is all about will help us learn more about loops, iterators, and Strings. You're making a palindrome checker in python WITHOUT string reversal. Good luck! :) Links: - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below: - www.teacherspayteachers.com/Store/Code-With-Conner ...
Let's Learn Python - String Functions - Unit 4 Topic 3
มุมมอง 2463 ปีที่แล้ว
Welcome to Unit 4 Topic 3 of Let's Learn Python. In this lesson we're going to learn python String functions and doing a quick challenge using string reversal: making a palindrome checker. Links: - www.w3schools.com/python/python_ref_string.asp - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below: - www.teacherspayteachers.com/Store/Co...
LLP - Learn from a Python teacher - Looping through strings - Unit 4 Topic 2
มุมมอง 3193 ปีที่แล้ว
Welcome to Unit 4 Topic 2. I've been a python and coding teacher for over 10 years. In this lesson we'll be discussing two different ways to loop through Strings in Python. For the challenge we'll just be testing this quick skill by printing an inputted word vertically. Links: - CodeWithConner: www.codewithconner.ca/ Purchase Code With Conner Teaching resources at any of the stores below: - www...
Let's Learn Python - Strings - Unit 4 - Topic 1
มุมมอง 3043 ปีที่แล้ว
Let's Learn Python - Strings - Unit 4 - Topic 1
Let's Learn Java - ArrayLists (an introduction)
มุมมอง 1433 ปีที่แล้ว
Let's Learn Java - ArrayLists (an introduction)
Let's Learn Python - Turtle Drawing Program - Unit 3 Project
มุมมอง 2583 ปีที่แล้ว
Let's Learn Python - Turtle Drawing Program - Unit 3 Project
Let's Learn Python - Try/Except Statements and Global Variables - Unit 3 Topic 4
มุมมอง 2623 ปีที่แล้ว
Let's Learn Python - Try/Except Statements and Global Variables - Unit 3 Topic 4
Let's Learn Python - Functions that return values - Unit 3 Topic 3
มุมมอง 3493 ปีที่แล้ว
Let's Learn Python - Functions that return values - Unit 3 Topic 3
Let's Learn Python - Functions that take parameters - Unit 3 Topic 2
มุมมอง 3473 ปีที่แล้ว
Let's Learn Python - Functions that take parameters - Unit 3 Topic 2
Let's Learn Python - Functions Part 1 - Unit 3 Topic 1
มุมมอง 3953 ปีที่แล้ว
Let's Learn Python - Functions Part 1 - Unit 3 Topic 1
Let's Learn Python - Unit 2 Project
มุมมอง 3383 ปีที่แล้ว
Let's Learn Python - Unit 2 Project
2D Arrays - AP Computer Science A
มุมมอง 6493 ปีที่แล้ว
2D Arrays - AP Computer Science A
Let's Learn Python - Turtle Graphics and Nested Loops - Unit 2 Topic 5
มุมมอง 8713 ปีที่แล้ว
Let's Learn Python - Turtle Graphics and Nested Loops - Unit 2 Topic 5
Arduino Basics Tutorial Series - Introduction
มุมมอง 2.8K3 ปีที่แล้ว
Arduino Basics Tutorial Series - Introduction
Let's Learn Python - While Loops - Unit 2 Topic 4
มุมมอง 3563 ปีที่แล้ว
Let's Learn Python - While Loops - Unit 2 Topic 4
Let's Learn Python - For Loops - Unit 2 Topic 3
มุมมอง 4533 ปีที่แล้ว
Let's Learn Python - For Loops - Unit 2 Topic 3
Let's Learn Python - If/Elif/Else Statements & Short Circuit Evaluation - Unit 2 Topic 2
มุมมอง 5623 ปีที่แล้ว
Let's Learn Python - If/Elif/Else Statements & Short Circuit Evaluation - Unit 2 Topic 2
Let's Learn Python - Booleans, Conditional and Logical Operators - Unit 2 Topic 1
มุมมอง 4983 ปีที่แล้ว
Let's Learn Python - Booleans, Conditional and Logical Operators - Unit 2 Topic 1
APCSA - Week 13 - Arrays in Java
มุมมอง 723 ปีที่แล้ว
APCSA - Week 13 - Arrays in Java

ความคิดเห็น

  • @aubtinthepro
    @aubtinthepro 3 วันที่ผ่านมา

    Great tutorial. Thanks!

  • @fatimasaba5566
    @fatimasaba5566 27 วันที่ผ่านมา

    What website are you using to show wirings on breadboard? Thanks

  • @n70tonka
    @n70tonka หลายเดือนก่อน

    tried to compile sketch and this is coming up Compilation error: 'Servo1write' was not declared in this scope i have tried fixing it with no luck . help please.

  • @MartinWibert
    @MartinWibert หลายเดือนก่อน

    Very nicely presented! However, I would also like to study the code off-line. I've looked around for it, but I can not find it. Can you please post a link to it? Thanks.

  • @nicedaymovie941
    @nicedaymovie941 4 หลายเดือนก่อน

    Hello, I would like to build a similar circuit for a model car (mechanical transmission). It should be operated with 2 buttons (up/down). Each time you press the button, the servo should adjust by 10 degrees (or another defined number of degrees). Neutral = 0 position 1st gear = one down Neutral = on up 2nd gear = one up 3rd gear = one up 4th gear = one up The entire transmission should then be switched up (UP) and down (down) using 2 buttons. It would be great if the “UP” button also had the function if you switched it to its 0 position (neutral) for 3 seconds. I would be very grateful if you could help me with this. Thank you. Greetings Hans

  • @C0SM1C313
    @C0SM1C313 4 หลายเดือนก่อน

    How do I get to the code?

  • @mohammed545
    @mohammed545 4 หลายเดือนก่อน

    U were recommened to me by AI

  • @mohammed545
    @mohammed545 5 หลายเดือนก่อน

    thanks

  • @timberhoff
    @timberhoff 5 หลายเดือนก่อน

    deserves a subscription!!

  • @QuqRose
    @QuqRose ปีที่แล้ว

    i eally don't know where is the mistakemaking thnk why wouldn't you JUST POST THE CODE!!! #include <Servo.h> int buttonPin = 4; int button2Pin = 7; int servoPin = 3 Servo ; int ServoPosition = 0; void setup() { Servo1.attach(servoPin); Servo1.write (servoPosition); Serial. begin (9600); } void loop() { int burtonState = digitalRead(buttonPin); int button2State = digitalRead(button2Pin); if(buttonState == HIGH && servoPosition <180) { Servo1.write(ServoPositton); ServoPositton++; delay(5) } else if(button1State a == HIGH ) { Servo1.write(servoPosition); ServoPosition--; delay(5) } }

    • @CodeWithConner
      @CodeWithConner ปีที่แล้ว

      Feel free to share if you want. I don’t post the code because I think there is better learning in following along and in the act of typing out the code and the brackets and all of it yourself. To each their own.

    • @olliecollins2
      @olliecollins2 3 หลายเดือนก่อน

      #include <Servo.h> int buttonPin = 4; int button2Pin = 7; int servopin = 3; Servo Servo1; int servoPosition = 0; void setup() { // put your setup code here, to run once: Servo1.attach(servopin); Servo1.write(servoPosition); } void loop() { // put your main code here, to run repeatedly: int buttonState = digitalRead(buttonPin); int button2State = digitalRead(button2Pin); if(buttonState == HIGH && servoPosition <180) { Servo1.write(servoPosition); servoPosition++; delay(5) ;}else if(button2State == HIGH ) { Servo1.write(servoPosition); servoPosition--; delay(5) ;}}

  • @desmondclyde6835
    @desmondclyde6835 ปีที่แล้ว

    I have an issue with my circuit and im hoping you could help. I have two servos connected to a button and i want the servos to start at zero to move to 45 degrees when button is pushed (not held), and when the button is pressed again, servos move back to 0. where in my code is it incorrect ? #include <Servo.h> int buttonPin =2; int servoPin =3; int servo2Pin =5; Servo servo1; Servo servo2; int servoPosition =0; int servoIncrement =4.5; void setup() { servo1.attach(servoPin); servo2.attach(servo2Pin); servo1.write(servoPosition); servo2.write(servoPosition); } void loop() { int buttonState =digitalRead(buttonPin); if (buttonState==HIGH&&servoPosition<=45) {servoPosition +=servoIncrement; servo1.write(45); servo2.write(45); delay(10); } if (buttonState==HIGH&&servoPosition>=0) {servoPosition-=servoIncrement; servo1.write(0); servo2.write(0); delay(10); } }

  • @desmondmensah3907
    @desmondmensah3907 ปีที่แล้ว

    Great video

  • @DriY
    @DriY ปีที่แล้ว

    how to save file with new name using push button?

  • @shakil1524
    @shakil1524 ปีที่แล้ว

    thanks, have a great day

  • @mohamedaboshady106
    @mohamedaboshady106 ปีที่แล้ว

    The word (Servo1) didn't activate durring writing the code broo !!

  • @BensHacks
    @BensHacks ปีที่แล้ว

    perfectly explained!

  • @sarojchaudhary9967
    @sarojchaudhary9967 ปีที่แล้ว

    Thank you for this information. But i want to store data from the SD FILE to an array. I need a solution please help me for my project

    • @CodeWithConner
      @CodeWithConner ปีที่แล้ว

      There's some good tips and info on here: forum.arduino.cc/t/how-to-read-values-from-sd-card-txt-into-an-array/473003

  • @steameducation8118
    @steameducation8118 ปีที่แล้ว

    omg thank u very much

  • @johnlake6321
    @johnlake6321 ปีที่แล้ว

    This is exactly what I needed to control the cueing and auto lift for my new turntable build. Thank you.

  • @Europayacht
    @Europayacht ปีที่แล้ว

    Extremely good! .

  • @felix2916
    @felix2916 ปีที่แล้ว

    Good video, but please do not add music during the explanation

  • @felix2916
    @felix2916 ปีที่แล้ว

    Would be great if you had included bubble sort and quick sort too. Good animations and explanations anyways!

    • @CodeWithConner
      @CodeWithConner ปีที่แล้ว

      Hey, yeah. I get that. I didn't because this was made for dual purpose with my AP students in mind and those 2 aren't part of the curriculum.

  • @alechenuiyoko7595
    @alechenuiyoko7595 ปีที่แล้ว

    Would the light come on without a resistor?

    • @CodeWithConner
      @CodeWithConner ปีที่แล้ว

      Usually yes, but sometimes, depending on the LED you'll burn out the diode. I over simplify the resistor stuff but you can look into it more and specific diodes work best with specific resistance. It's not one size fits all like I make it seem :)

  • @kataramanN16
    @kataramanN16 ปีที่แล้ว

    Can you please tell me the code for when i pressed the two buttons together then the servo goes to 0 ??? i loved the tutorial from your video...keep up the good work!!!

    • @CodeWithConner
      @CodeWithConner ปีที่แล้ว

      Email codewithconner@gmail.com and I can send you solution code.

  • @ninodeceuster2146
    @ninodeceuster2146 ปีที่แล้ว

    hey hey, I used your code and it works perfect! but I want my servo to turn slower. How do you have to change this code so that the servo will turn slower, because it is going quite fast now?

    • @CodeWithConner
      @CodeWithConner ปีที่แล้ว

      The easiest way would be to just increase the length of the delay inside the if/else statement in your loop function where you increment/decrement the servoposition variable.

  • @ivanatorres447
    @ivanatorres447 2 ปีที่แล้ว

    Really nice video! thanks for all the information. I'm having a problem with the recording in the SD card, it only record 3 minutes of data ~10 kb in a 2 GB SD card, do you have any idea what can be wrong?

    • @CodeWithConner
      @CodeWithConner ปีที่แล้ว

      Hard to say to be honest. I'd have some debug statements either running to the console or to the SD card to try and get a sense of when/why it is failing? I know I've had SD cards that gave me a lot of trouble and others that worked seamlessly.

  • @inertproductionsalternate9114
    @inertproductionsalternate9114 2 ปีที่แล้ว

    On the previous challenge I actually did the int dot and int dash. Made life so much easier when I was trying to mess with timing to get it to look right.

  • @inertproductionsalternate9114
    @inertproductionsalternate9114 2 ปีที่แล้ว

    HAHA. Light wasn't coming on. Then I remember LED(light emitting DIODE) aka current direction limiter. I had it spun around the wrong way. Great video series. Despite my mistake I know a fair bit about electronics I'm doing this to learn Arduinos code system. I like the challenges at the end. Keep up the good work.

  • @joaopereira2659
    @joaopereira2659 2 ปีที่แล้ว

    thank you for your turtorial, but i'm getting the error "error opening test.txt", but after it says "data written sucessfully".. after I put the SD in my laptop, and i saw 3 files (1 .sys and 2 without extention) written with strange caracters

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      Something funny happening there for sure. If you want to email me codewithconner@gmail.com with your code I can have a look.

  • @marklaslett9613
    @marklaslett9613 2 ปีที่แล้ว

    Really loved your video. Great teaching style. I understand the coding. Have typed in code, checked and checked, but when I compile, after : else if(button2State == HIGH) && servoPosition >=0 //else if we are over 0 button 2 is on" get "expected ";" before "{" token. Can't see the error!. Frustrating

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      Can you paste the whole if/else if blocks of code here or email them to me codewithconner@gmail.com

    • @marklaslett9613
      @marklaslett9613 2 ปีที่แล้ว

      @@CodeWithConner here it is if(buttonState == HIGH) && servoPosition <180 //if we are under 180 button 1 is on { Servo1.write(servoPosition); //write current position servoPosition++; //add 1 to position delay(5); //delay 5 ms } else if(button2State == HIGH) && servoPosition >=0 //else if we are over 0 button 2 is on { Servo1.write(servoPosition); //write current position servoPosition--; //subtract 1 to position delay(5); //delay 5 ms }

  • @ricardrinaldo4791
    @ricardrinaldo4791 2 ปีที่แล้ว

    Thank you so much 👍

  • @HashirEasa
    @HashirEasa 2 ปีที่แล้ว

    can you make a pdf reader with the arduino uno tft touch screen shield? i need help coz im a beginner trying to make a pdf reader thingy with a 612 page pdf file

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      Not something I’ve ever looked into yet. Sorry.

    • @HashirEasa
      @HashirEasa 2 ปีที่แล้ว

      @@CodeWithConner okay

  • @soundtown2277
    @soundtown2277 2 ปีที่แล้ว

    Thank you very much 😊

  • @sridharkrishnappanavanerth3388
    @sridharkrishnappanavanerth3388 2 ปีที่แล้ว

    were is the codes for your challenges and extension.

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      Somewhere deep in your mind I hope :) I don’t share it publicly but it is part of my teaching materials for teachers who use the video series with their classes. But if you run into a bug when working through them feel free to email me codewithconner@gmail.com

  • @paolajadecalunsag5876
    @paolajadecalunsag5876 2 ปีที่แล้ว

    hi! does this work on arduino mega?

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      If I were to guess I’d say 90% of the code will be the same. But the wiring will likely have a few differences

  • @salc9593
    @salc9593 2 ปีที่แล้ว

    I would like to ask where would I place this code of I want to Fade Up and Down a single LED 5 times. Awaiting your replay and thank you for your informative video

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      I guess it depends if you want it to be triggered by a button press, you'd put the call to do the fade up/down sequence from within the button press if statement. Maybe make a function to actually do the fade up/down one time, then you can loop and call it 5 times if you want it to do it that many times.

  • @jaysampson2862
    @jaysampson2862 2 ปีที่แล้ว

    could i use this to code a game.. for example DDLC? because you are able to code the game, i’m just wondering if i could code the game with this and change it more

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      I mean, you "could" use this for some sort of simple game. But Arduino's are definitely not designed with that intent.

  • @deathxsense
    @deathxsense 2 ปีที่แล้ว

    Dude I dont know why this doesnt have more views & likes. Thank you so much! Quick tip if someone is struggling with the code using Arduino MEGA: remove GND pin from the micro SD module, and disconnect and connect the SD card. I was stuck with the "SD initialization failed" message and the latter fixed the problem. PS. you got a new subscriber. Thank you again!

  • @B16Dominoes
    @B16Dominoes 2 ปีที่แล้ว

    Thanks for the tutorial. I subscribed

  • @bretandrews8522
    @bretandrews8522 2 ปีที่แล้ว

    Code didn't work for me. #include <Servo.h> int buttonPin = 4; int button2Pin = 7; int servoPin = 3; Servo Servo1; int servoPosition = 0; void setup() { // put your setup code here, to run once: Servo1.attach(servopin); Servo1.write(servoPosition); } void loop() { // put your main code here, to run repeatedly: int buttonState = digitalRead(buttonPin); int button2State = digitalRead(button2Pin); Error massage says ServoPin was not declared in this scope

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      When you declared servoPin you used a capital P but when you access it later you used a lower case p. That’s why it can’t find it.

  • @mayeshadeen
    @mayeshadeen 2 ปีที่แล้ว

    2:09

  • @shingiechakoma1317
    @shingiechakoma1317 2 ปีที่แล้ว

    Well explained, thanks!

  • @chiefrunningfist
    @chiefrunningfist 2 ปีที่แล้ว

    @3:26 lol oh the days before dial up, coding QBasic on the 386

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      Shhh. They’ll find out how old we are 😀

  • @tazcurrier2193
    @tazcurrier2193 2 ปีที่แล้ว

    EVEN BETTER... HAVE A SPDT SWITCH, AND USE THE SWITCH TO DETERMINE THE DIRECTION OF THE SERVO, AND A PUSH BUTTON, TO TELL IT TO MOVE TO THAT POSITION, WHEN COMMANDED. HOW WOULD YOU DO THAT? i HAVE TRIED SEVERAL WAYS, AND CANNOT GET IT TO STAY IN EITHER POSITION. IT JUST CYCLES BACK AND FORTH, NEVER STOPS... I AM FRUSTRATED. I LEARN BETTER WHEN SHOWN HOW TO DO SOMETHING, AND THEN I CAN APPLY IT, TO OTHER SITUATIONS THAT I AM WORKING WITH AT A LATER DATE. THANKS AGAIN!!!

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      So really the idea here is that whatever is in your loop() function directly will just keep happening over and over again. The key to all of this is the if statements in the loop function. There are a couple reasons this can get messed up, for example depending on how you are detecting your button state. Even though we might think we aren't holding a button down, the Arduino will recognize it several thousand times in a second potentially. Having a delay built in anytime it detects a button push helps prevent it re-running the code more than once per button press. But, if you have no motor movement in your main loop() function, but an if statement for a button that just moves it a certain amount in a certain direction and doesn't do any kind of looping or incremental change this should be doable. something like: if(buttonstate==HIGH){Servo1.write(120); delay(1000);} would just move the motor to 120 and do nothing else.

  • @tazcurrier2193
    @tazcurrier2193 2 ปีที่แล้ว

    OK, i HAVE BEEN ABLE TO DO THIS, HOWEVER, WHAT IF i WANT TO HOLD THE SERVO, IN EACH POSITION? SAY, i PUSH THE LEFT BUTTON, AND, THE SERVO MOVES TO 60 DEGREES, STOPS, AND HOLDS POSITION, UNTIL COMMANDED TO MOVE, BY THE RIGHT BUTTON? SAME THING WITH THE RIGHT BUTTON. I WANT IT TO MOVE TO 160 DEGREES POSITION, STOP AND HOLD THERE, UNTIL COMMANDED TO MOVE. HOW WOULD YOU CODE THAT? THANKS!!!

  • @malcolmrobinson2055
    @malcolmrobinson2055 2 ปีที่แล้ว

    Conor , I would like to use a PCA9865 , have you any videos on how this would work rather than a direct feed form ardiuno board ...i want to move the servo to preset positions depending on a feed from a toggle switch ..

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      So I haven't done a project video with a servo breakout board like this, but they are awesome. This site has a ton of good info on setting one up though: learn.adafruit.com/16-channel-pwm-servo-driver?view=all

  • @DrDougan
    @DrDougan 2 ปีที่แล้ว

    can you do this but instead of a display a fan, so if the temp is high it turs on, if its low, it stays of?

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      absolutely you could. In the if statements that detect the temperature value you would just trigger the pin controlling the fan to turn it on/off.

  • @sbaxter4207
    @sbaxter4207 2 ปีที่แล้ว

    i understand the 'for loop' and i understand 'the 'while loop'. however, they seem to do the same thing, but are just coded differently , is that correct or have I completely missed something? perhaps each of these loops are more suitable for different situations?

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      You nailed it with the "different situations" part of your comment. They are absolutely both functional and interchangeable in almost all situations but one will usually be easier to write and trace for different cases. My usual go to is that if it's a fixed number of loops, use a for loop. If it's based on some user generated trigger or sensor generated trigger, use a while, but that isn't a hard rule.

    • @sbaxter4207
      @sbaxter4207 2 ปีที่แล้ว

      @@CodeWithConner thank you. Much appreciated, i feel I regained an IQ point. lol : )

  • @DMES-wp2fj
    @DMES-wp2fj 2 ปีที่แล้ว

    hello can anyone tell me what code to use to break a while loops loop for example if i press PB 1 the code inside the while loop will run but if i press PB2 the code will stop kinda like a reset button and if I press PB again the loop will play once more

    • @CodeWithConner
      @CodeWithConner 2 ปีที่แล้ว

      you can use a "break;" statement inside of a loop that will immediately exit the loop structure.

  • @valentinbernard3324
    @valentinbernard3324 2 ปีที่แล้ว

    This was so fun! The extension took about 30 minutes to figure out. Thanks for the great tutorial and challenge.