Posts

Showing posts from October, 2023

Sensors and Actuators

Image
Smart Systems and Sensors To create the image above you will need the following items; Arduino Uno  USB Lead  3 Breadboard Jumper Wires Servo Motor *SG-90   Servo motors are electronic devices and rotary or linear actuators that rotate and push parts of a machine with precision. Servos are mainly used on angular or linear position and for specific velocity, and acceleration. To find the code for the servo motor, open Arduino in  File  > Examples  > Servo > Sweep . Before connecting up the devices must find out what the wires on the servo motor means and where it must be connected on the Arduino. To find this source is on the internet, snipped is shown below. GND > Brown Wire PWM > Orange Wire +5V > Red Wire Within the sweep code the for loop has three conditions for its position; pos = 0 *start at 0 pos <= 180 *continuation condition if the  value is less than or equal to 180 pos += 1 *add 1 to the pos The first loop starts at...

MIDI Instrument

Image
                 Using the Arduino Uno to make music along with SynthEdit To achieve this you will need the following items; Arduino Uno USB lead LDR Switch  10K resistor 220r resistor Midi to USB interface Plug your Uno board into the PC and check that the correct serial port and board is selected in the Tools tab. Before you connecting the midi to your board, open up the appropriate code under File > Examples > 4. Communication > Midi  and upload the file. Also, open up SynthEdit create a new file and drop in Synth PD303 . In Edit open preferences > audio & midi , change Midi in and out to USB2.0-MIDI. After plugging in the Midi connect the r esistor in 5V and wire in TX >1. This will create a sound going up in scale to ensure that the code was uploaded successfully. Within the Midi code in the for loop note is denoted with hexadecimal. 20 start   < 72 condition   ++ (add one to it)...

LED Sensors

Image
Parts of the Arduino UNO An LED attached to number 13, which behaves differently from the other outputs. The clock sets the speed of the board measured in megahertz. The reset button to reboot the board. The microcontroller used to store information and can be removed to use separately. The power supply does not require to be plugged in for the board to be used. Software required is called Arduino IDE Everything on this IDE is written on a loop. void setup() - in this is where parameters are set for the digital pins telling them what they are if inputs or outputs and how fast they are communicating * with different speeds most variables within the arudino code are best used globally as it can be used with every function created. In this we will use Blink instead of Hello World to retrieve an output signal. The file is found in File > Examples > 1. Basics > Blink. Within the above BLINK code it is translated as follows; LED_BUILTIN = PIN 13 (on the Arduino...