======EAPX====== Edit your section here and provide a description of what it is you’d like to build by the end of this endeavour. From the tutorial or other resources, identify what components from your electronics kit you are going to be testing, and provide any pertinent information regarding its operation (ie not entire programs, but succinct nuggets of information that could be useful to others wanting to get up and running). Edit your section here and provide that pertinent information. =====acuno===== ====premise==== My plan is to control a stepper motor using two buttons. One button will make the stepper motor rotate some fixed amount clockwise. The other button will make the stepper motor rotate the same fixed amount counterclockwise. The rotation amount will be hard-coded into the program. Perhaps if everything else goes smoothly, I'll try to use a potentiometer to control the motor rotation amount. ====part1==== For the first week I started with wiring and coding a stepper motor. I have a program which continuously moves the stepper motor either clockwise or counterclockwise. Next I need to expand the program to rotate a certain fixed amount and also use the states of the buttons to control direction. ====part2==== The buttons have been added in to the wiring. The feedback from the buttons has also been incorporated into the program. Currently, the stepper motor rotates continuously one direction while one button is pressed, and continuously in the other direction while the other button is pressed. Next I need to program the motor to rotate a fixed amount upon each button press. {{:notes:c4eng:fall2023:projects:20231108_204827.jpg?400|}} ====part3==== The stepper motor system works well. There are two buttons. When one of the buttons is pressed, the motor rotates clockwise. When the other button is pressed, the motor rotates counterclockwise. The amount that the motor rotates is set within the program. {{:notes:c4eng:fall2023:projects:20231108_204902.jpg?linkonly|}} =====cgaffne1===== ====premise==== description of what you are looking to do ====part1==== description of what component(s) you have selected and are testing ====part2==== description of changes made and construction pursuits, and some details of C program interaction ====part3==== description of finished project details (not full source code), but present your finished product =====clamphi3===== ====premise==== I want to use joystick to change the color of a 4 legged light. ====part1==== I used the following code to read the x,y & z values of the joystick as it moves.
#include====part2==== I set up the leds circuit and using softPwmWrite made it so the lights numerical sate coresponded to the x,y or z value it was linked to. Although the z value can only be 1 or 0 so when it equaled 0 the third pin to the light would equal 100.#include #include #include #include "ADCDevice.cpp" #include ///////////////////////////////////////////////////////////////////// #define Z_Pin 1 //define pin for axis Z ADCDevice *adc; // Define an ADC Device class object ///////////////////////////////////////////////////////////////////// int main(void){ adc = new ADCDevice(); printf("Program is starting ... \n"); if(adc->detectI2C(0x48)){ // Detect the pcf8591. delete adc; // Free previously pointed memory adc = new PCF8591(); // If detected, create an instance of PCF8591. } else if(adc->detectI2C(0x4b)){// Detect the ads7830 delete adc; // Free previously pointed memory adc = new ADS7830(); // If detected, create an instance of ADS7830. } else{ printf("No correct I2C address found, \n" "Please use command 'i2cdetect -y 1' to check the I2C address! \n" "Program Exit. \n"); return -1; } wiringPiSetup(); pinMode(Z_Pin,INPUT); //set Z_Pin as input pin and pull-up mode pullUpDnControl(Z_Pin,PUD_UP); while(1){ int val_Z = digitalRead(Z_Pin); //read digital value of axis Z int val_Y = adc->analogRead(0); //read analog value of axis X and Y int val_X = adc->analogRead(1); printf("val_X: %d ,\tval_Y: %d ,\tval_Z: %d \n",val_X,val_Y,val_Z); delay(100); } return 0; }
val_Z = digitalRead(Z_Pin); //read digital value of axis Z if(val_Z == 0){ softPwmWrite(HREPIN, 100); } else{ softPwmWrite(HREPIN, 0); } ///////////////////////////////////////////////////////////// val_Y = adc->analogRead(0); //read analog value of axis X and Y softPwmWrite(TWOPIN , val_Y); ///////////////////////////////////////////////////////////// val_X = adc->analogRead(1); softPwmWrite(ONEPIN , val_X);https://youtu.be/nE6sX5U6sz4 ====part3==== When moving the joystick around the light changes color and when any of the values hit their max one of the single led's will turn on.
///////////////////////////////////////////////////////////// val_Z = digitalRead(Z_Pin); //read digital value of axis Z if(val_Z == 0){ softPwmWrite(HREPIN, 100); digitalWrite (GRNLED, 1); } else{ softPwmWrite(HREPIN, 0); digitalWrite (GRNLED, 0); } ///////////////////////////////////////////////////////////// val_Y = adc->analogRead(0); //read analog value of axis X and Y softPwmWrite(TWOPIN , val_Y); if (val_Y == 247){ digitalWrite (REDLED, 1); } else{ digitalWrite (REDLED, 0); } /////////////////////////////////////////////////////////////https://www.youtube.com/playlist?list=PLpR-bDNsxP5swtO5DQ5bhKbo7tLxqU75V =====clovell3===== ====premise==== description of what you are looking to do ====part1==== description of what component(s) you have selected and are testing ====part2==== description of changes made and construction pursuits, and some details of C program interaction ====part3==== description of finished project details (not full source code), but present your finished product =====dcookjr===== ====premise==== description of what you are looking to do ====part1==== description of what component(s) you have selected and are testing ====part2==== description of changes made and construction pursuits, and some details of C program interaction ====part3==== description of finished project details (not full source code), but present your finished product =====jklotz2===== ====premise==== description of what you are looking to do ====part1==== description of what component(s) you have selected and are testing ====part2==== description of changes made and construction pursuits, and some details of C program interaction ====part3==== description of finished project details (not full source code), but present your finished product =====jparrish===== ====premise==== for the project, i plan on creating a circuit utilizing the ultrasonic sensor, 3 leds , and a buzzer. The overall goal is to make it so that at a certain distance an object is from the sensor, the leds will fill up, and when the leds are all on, a buzzer will go off. \\ I understand the premise of the circuit, and believe this will be an easy but tedious task. ====part1==== ULTRASONIC SENSOR - a sensor that measures distance based on how long a sound wave takes to bounce back \\ ACTIVE BUZZER - a buzzer that makes noise when power is sent to it \\ LED - a light emitting diode ====part2==== all that had to be done, was grab the c code downloaded with the starter manual for the pi, then add a couple if statements to compare the distance to a set distance, and if the distance was smaller, to turn on each light and then the buzzer, all of which were put into an array \\ the sensor needed to be hooked up to two different pins, with the echo pin needing 3 1kohm resistors also leading to our ground \\ the buzzer only needed a 1kohm resistor leading to a transistor, which ultimatly controls the buzzer \\ each led needed a 220ohm resistor. ====part3==== looks like a piece of junk, but the closer you move your hand, the more lights pop up. the lights are put out of the way of the wires so its easier to see. Essentially, the pi is generating distance info with the sonar, then comparing that to a set distance, and turning on and off pins as it exceeds or fails to exceed those set distances {{ :notes:c4eng:fall2023:projects:img_6624.jpg?nolink&400 |}} =====lbond1===== ====premise==== I want to use the seven segment display as a counter of some kind. I will probably use it with a button and a switch that makes the number displayed increase or decrease. ====part1==== I am testing the Seven Segment Display, which uses the 74HC595 chip to display a variety of symbols. It can be used in counting, and I want to test its ability to count in hexadecimal. {{:notes:c4eng:fall2023:projects:screen_shot_2023-11-08_at_4.47.32_pm.png?400|}} ====part2==== In this part, I wanted to test how I could use the button with the seven segment display. I decided to have the button change the speed at which the display counted. Pressing the button more, means that the counter will slow down, since the delay is greater. I could also use another button or a switch to make it speed up as well, but this was mostly to confirm that the button could work and affect the seven segment display {{:notes:c4eng:fall2023:projects:screen_shot_2023-11-08_at_4.52.41_pm.png?400|}} ====part3==== For the finished product, I have a seven segment display that shows a hexadecimal counter that can be slowed down or sped back up to regular speed. Pressing the blue button slows the counter down the more you press it. Pressing the red button sets the speed at which it counts back to normal. These two buttons can be used to slow or speed up the counter in a way, without having to worry about a negative delay happening. {{:notes:c4eng:fall2023:projects:screen_shot_2023-11-15_at_5.12.52_pm.png?400|}} =====lrogers3===== ====premise==== For my project I will be working with the 7-Segment Display and learning more about its functions along with 74HC595 chip. The display allows you to see an actual number or letter. {{:notes:c4eng:fall2023:projects:img_6359.jpg?400|}} ====part1==== I left enough room at the bottom to test out using a button to control the display, one button to count up and another button to count down. Thats not definite. ====part2==== I would like to explore using the 74HC595 chip with the seven segment display. I would like to program it to count even, odd then 0-9 number. ====part3==== description of finished project details (not full source code), but present your finished product =====lwebb3===== ====premise==== description of what you are looking to do ====part1==== description of what component(s) you have selected and are testing ====part2==== description of changes made and construction pursuits, and some details of C program interaction ====part3==== description of finished project details (not full source code), but present your finished product =====mgillet3===== ====premise==== The end project will be a timer that is turned on and off with a button and utilizes the 4 digit 7-segment display ====part1==== I have decided to start with testing out the single digit 7-segment display and trying to display numbers 0 through 9 ====part2==== Now I will be using to 4 digit seven segment display as opposed to the 1 digit display. My main goal for this segment of the project is to get the numbers to both display and to change. ====part3==== description of finished project details (not full source code), but present your finished product =====mmatti11===== ====premise==== Use a proximity sensor to determine the distance and display on an lcd screen. ====part1==== I will be using a proximity sensor or ultrasonic sensor and an lcd screen for this project. ====part2==== description of changes made and construction pursuits, and some details of C program interaction ====part3==== description of finished project details (not full source code), but present your finished product =====mwinter4===== ====premise==== In my project, I would like to control some servos using data from the mpu6050. Ultimately, these will be attached to control surfaces in an "autopiloted" glider. Eventually, I would also like to use an ultrasonic sensor to detect how far this system is from the ground and initiate a landing sequence. ====Components==== The components I have selected are the mpu6050 and servos attached to an Arduino Nano. The mpu6050 is a "motion tracking" device that provides accelerometer and gyroscope data necessary for this project. The mpu6050 only needs to be connected through SDA and SCL to provide data to our microcontroller (and of course power/gnd). The servos are motors that can be used to precisely control our glider's control surfaces. The servos can be controlled via data line and must be connected to a PWM pin on the Arduino Nano. There is a handy-dandy Arduino library called "Servo.h" that simplifies the process of controlling servos greatly. You can initialize servos as objects in the code and easily write angles to servos without needing to worry about PWM (Pulse-Width Modulation). The Arduino Nano is the microcontroller I am using to control the components in this circuit. Using the Arduino IDE we can load "sketches" (instructions) onto the Arduino Nano. The Arduino IDE uses its own modification of C/C++. The Arduino can be provided power (and sketches) through its mini USB port, or can be powered by a battery up to 12V (recommended). Before submitting code sketches to the Arduino Nano, you can click the verification button in the IDE to compile the code and see any errors. ====part2==== ===video=== https://discord.com/channels/738748325217697856/739521309998055514/1171922802668994633 ===updates=== The MPU6050, Arduino Nano, and Servos have all been integrated on a circuit together. The servo meant to control the rudder has been fixed. Instead of using accelerometer data from the MPU6050, registers
//// X-axis: "Yaw", although this would normally be the Z-axis
Wire.beginTransmission(mpu6050);
Wire.write(0x47); // gyroscope instead of accelerometer
Wire.endTransmission(false);
Wire.requestFrom(mpu6050, 4, true);
AcX = Wire.read() << 8 | Wire.read();
x_ang = AcX/180;
The first 3 lines of this block,
Wire.beginTransmission(mpu6050);
Wire.write(0x47); // gyroscope instead of accelerometer
Wire.endTransmission(false);
are mostly self-explanatory.
On the first line, we're starting an I2C connection to the MPU6050 using it's address (0x68).
From the second line, we queue up the information we want to send; namely, the register we're trying to access.
And the third line ends the transmission, sending that information on its merry way over to the MPU6050.
The next three lines of code:
Wire.requestFrom(mpu6050, 4, true);
AcX = Wire.read() << 8 | Wire.read();
x_ang = AcX/180;
On the first, we're requesting bytes at the register address 0x47 (as previously set up) from the MPU6050. Specifically, we're requesting 4 bytes. Our final argument,