The angle range you can use for these two servos are narrower because of the design. However, this is not the same case for NovaServo_1 and NovaServo_5. Most of the times, these servos allow you to use 0 - 180 degrees range without any collisions or causing high stress levels for the casing parts or servos. IMPORTANT: Note that for NovaServo_2, NovaServo_3 and NovaServo_4, the angle range you can set for these servos are quite wide. This is why you are starting with small angle changes to get to know Nova and to prevent any damages. Never forget that you are programming Nova from scratch and that there are no built-in collision detections unless you create one. Repeat the same procedure with 5 or 10 degree increments to see how Nova moves and also to see if there is any parts that collide in a specific position of the servo motors. Change the function as below and upload it to Nova again by clicking the upload symbol on the top left corner of Arduino Software (IDE). As your Nova is currently positioned at 90 degrees, you can start by changing the angle of the NovaServo_2 to 85 or 95 degrees angle. When changing the angle, always start with small increments or decrements. We need to comment all the other servo motors by putting "//" in front of them in the loop() function, so there is no need to set a specific angle to other servos apart from the one we will be working with. For this purpose, we will need the servo which is connected to pin 34 (NovaServo_2). Now, it is time to play around with these functions in order to move Nova as we wish.įirstly, let's start by changing the angle of Nova's face. Congratulations! You have uploaded your first sketch to Nova. If you hear some noise coming from servos or see some servo jittering, it is completely normal. Nova should be positioned with all its servos set at 90 degrees. Now, plug Nova to a power socket with the power adapter provided in the kit. If everything is okay, click the upload symbol on the top left corner of Arduino Software (IDE) and your code should be uploaded. If not, do the assembly correctly in order to avoid any damages to Nova. As you have already assembled Nova with servos oriented at 90 degrees, this sketch will put Nova in its stationery position which is seen in the illustration at the beginning of this chapter.īefore uploading the sketch to Nova, as a last warning, make sure you have set the servos to 90 degrees angle during the assembly and fitted the parts together with the same relative positions as shown in the assembly booklet. This sketch will program Creoqode Mini Mega to send signals to all 5 servos and to set them all in 90 degrees angle. Now, your first sketch is ready to be uploaded to Nova. Otherwise, Arduino Software (IDE) will see your comment as command, and will generate an error message. Never forget to put "//" at the beginning of your comment. As an example, we will be adding the below comments in our sketch, but you can write whatever you want unless it makes it easy for you to see the role of each servo. It can be frustrating and time consuming to trace the wire of the servo everytime and check which pin it is connected to. You can always use these comments as reference when programming different movements for Nova. We will now write comments next to the servo motors we created, to remind us which servo is responsible for which movement. You explain the role of the functions, the structure of the sketch, certain variables etc. Not only for yourself, but also it makes it easier to understand your code for others who are reading it. While coding, it is always a good habit to put comments in your sketch that will remind you anything you think is important and essential. To be able to use the servo functions while programming Nova, we have to include the library in our sketch by adding the below line on top: If you want to customise Nova in the future by adding new movement capabilities, remember that you have spare pins for 43 more servo motors! Note that servos draw considerable power, so if you need to drive more than one or two, you'll need to power them from a separate supply which is Nova Servo Shield in our case that is connected to a power socket. The Servo library supports up to 48 servos on Creoqode Mini Mega and Arduino Mega. Servo motors allows the shaft to be positioned at various angles, between 0 and 180 degrees in Nova's case. Servos have integrated gears and a shaft that can be precisely controlled. This library allows Creoqode Mini Mega or an Arduino board to control servo motors. To be able to communicate with the servo motors with the ease of a function, we need to use the built-in Servo Library provided with the Arduino Software (IDE). After selecting the correct hardware options from the Tools menu, let's continue by creating our first sketch.
0 Comments
Leave a Reply. |