The document discusses code for independently flashing 3 LEDs with different on and off periods using an Arduino Uno board. The author has set up the hardware with 3 LEDs connected to digital pins 6, 7 and 8. Their code currently causes all LEDs to flash with the same on/off period rather than independently. They are seeking help altering their code to independently control the on and off periods of each LED. Several suggestions are provided, including using external interrupts triggered by a separate pin and counting interrupts to control the LED timing. However, the author is still struggling to get the LEDs flashing independently as intended.
In this session IOT expert Bob Gallup walked us through the basics of electronics and taught us how to do some basic wiring and programming on an Adafruit Trinket micro processor.
This document provides an overview of how to use Arduino microcontrollers for beginners. It explains what Arduino is, the basic components and programming structure used in Arduino, and how to get started with coding and hardware setup. The key aspects covered include computers and programming languages, microcontrollers and their applications, Arduino development boards, initial setup steps, basics of Arduino coding like initialization, setup, loop, and user defined functions. It also discusses analog and digital signals, serial communication, and tips for wiring and coding Arduino projects.
This document provides an overview of Arduino programming and the Arduino platform. It discusses what Arduino is, what types of projects can be built with Arduino, and covers the basics of getting started, digital and analog inputs/outputs, Neopixels, and putting projects together. It also includes an agenda and summaries of the Arduino UNO board and common sensors that can be used.
The document provides an introduction to programming with Arduino. It explains that Arduino is an open-source hardware and software platform used to build interactive electronic projects. It consists of a microcontroller board that can be programmed and used to read and control sensors, LEDs, motors and more. The document outlines the basic steps to get started which include downloading the Arduino IDE, installing drivers, selecting the board type, and uploading a test "Blink" program to make an LED turn on and off. It also provides explanations of some core electronic components like resistors, LEDs, sensors and describes how to set up a simple temperature sensing project and store the sensor readings in a database.
This document provides an overview of a lab on using Arduino. The schedule includes lectures on Arduino, installing drivers, and using an ultrasonic sensor. It defines Arduino as a hardware and software platform and describes the Arduino UNO board. It explains how to install the Arduino IDE and write programs with a setup and loop structure. Lab 1 demonstrates controlling an LED, and Lab 2 uses an ultrasonic sensor to measure distance. Lab 3 builds a minimum system using just an AVR chip.
This document provides information about different types of sensors, including infrared (IR), temperature, and sound sensors. It discusses the basic working principles of IR sensors, including how they detect objects based on reflected IR light. The document also describes temperature sensors that output a voltage proportional to temperature. Finally, it explains how sound sensors use a microphone and 555 timer integrated circuit to measure sound pressure variations and generate pulses. Key components discussed include the LM358 comparator, LM35 temperature sensor, and operating modes of the 555 timer IC like monostable, bistable, and astable.
This document provides an outline and overview of the topics that will be covered in Lecture 6 of the CSE P567 course, including the ATmega328 architecture, I/O pins, the Arduino C++ language, and timing functions. It discusses the ATmega328's Harvard architecture with separate flash, SRAM, and EEPROM memory spaces. It describes the AVR CPU, registers, addressing modes, instruction set, and I/O functionality. It also covers the Arduino development board's pin mapping and digital/analog I/O functions.
The document provides an overview of an Arduino workshop. It outlines exercises that attendees will complete, including blinking an LED, reading a button input, and fading an RGB LED using pulse width modulation. It also discusses what Arduino is used for, such as interactive art, robots, and commercial products. Examples of where Arduino is used include schools, art installations, and 3D printers.
In this session IOT expert Bob Gallup walked us through the basics of electronics and taught us how to do some basic wiring and programming on an Adafruit Trinket micro processor.
This document provides an overview of how to use Arduino microcontrollers for beginners. It explains what Arduino is, the basic components and programming structure used in Arduino, and how to get started with coding and hardware setup. The key aspects covered include computers and programming languages, microcontrollers and their applications, Arduino development boards, initial setup steps, basics of Arduino coding like initialization, setup, loop, and user defined functions. It also discusses analog and digital signals, serial communication, and tips for wiring and coding Arduino projects.
This document provides an overview of Arduino programming and the Arduino platform. It discusses what Arduino is, what types of projects can be built with Arduino, and covers the basics of getting started, digital and analog inputs/outputs, Neopixels, and putting projects together. It also includes an agenda and summaries of the Arduino UNO board and common sensors that can be used.
The document provides an introduction to programming with Arduino. It explains that Arduino is an open-source hardware and software platform used to build interactive electronic projects. It consists of a microcontroller board that can be programmed and used to read and control sensors, LEDs, motors and more. The document outlines the basic steps to get started which include downloading the Arduino IDE, installing drivers, selecting the board type, and uploading a test "Blink" program to make an LED turn on and off. It also provides explanations of some core electronic components like resistors, LEDs, sensors and describes how to set up a simple temperature sensing project and store the sensor readings in a database.
This document provides an overview of a lab on using Arduino. The schedule includes lectures on Arduino, installing drivers, and using an ultrasonic sensor. It defines Arduino as a hardware and software platform and describes the Arduino UNO board. It explains how to install the Arduino IDE and write programs with a setup and loop structure. Lab 1 demonstrates controlling an LED, and Lab 2 uses an ultrasonic sensor to measure distance. Lab 3 builds a minimum system using just an AVR chip.
This document provides information about different types of sensors, including infrared (IR), temperature, and sound sensors. It discusses the basic working principles of IR sensors, including how they detect objects based on reflected IR light. The document also describes temperature sensors that output a voltage proportional to temperature. Finally, it explains how sound sensors use a microphone and 555 timer integrated circuit to measure sound pressure variations and generate pulses. Key components discussed include the LM358 comparator, LM35 temperature sensor, and operating modes of the 555 timer IC like monostable, bistable, and astable.
This document provides an outline and overview of the topics that will be covered in Lecture 6 of the CSE P567 course, including the ATmega328 architecture, I/O pins, the Arduino C++ language, and timing functions. It discusses the ATmega328's Harvard architecture with separate flash, SRAM, and EEPROM memory spaces. It describes the AVR CPU, registers, addressing modes, instruction set, and I/O functionality. It also covers the Arduino development board's pin mapping and digital/analog I/O functions.
The document provides an overview of an Arduino workshop. It outlines exercises that attendees will complete, including blinking an LED, reading a button input, and fading an RGB LED using pulse width modulation. It also discusses what Arduino is used for, such as interactive art, robots, and commercial products. Examples of where Arduino is used include schools, art installations, and 3D printers.
This document provides an introduction to using Arduino boards. It discusses getting started with the Arduino IDE, programming basics like digital I/O and timing functions. Examples are provided to blink an LED, read a digital sensor, read an analog sensor with a potentiometer, and fade an LED using pulse width modulation. Terminology around bits, bytes and serial communication is also explained. The document aims to teach Arduino fundamentals and provide practice examples for learning.
The document discusses code for Arduino projects involving buttons and LEDs. It provides code for blinking an LED without using delays, as well as code for debouncing a button circuit to avoid erroneous readings from switch noise or bouncing. The debouncing code uses variables to track button states and millis() to measure time between button presses and only register a change after a debounce delay. It also discusses setting up circuits for these projects using an Arduino, breadboard, button, LED, and resistors.
This document provides an overview and introduction to the Arduino software and programming environment through a series of tutorials. It begins by explaining how to download and install the Arduino software and interface. It then demonstrates a basic "Blink" code to turn an LED on and off as an introduction to Arduino programming. The document outlines the various sections of code, such as void setup() and void loop(), and basic syntax like semicolons. It also explains how to upload code to the Arduino board and view the output.
Arduino Workshop Day 1 Slides
Basics of Arduino - Introduction, Basics of Circuits, Signals & Electronics, LED Interfacing, Switch, Buzzer, LCD & Bluetooth Communication.
This document provides an overview of microcontrollers and the Arduino platform. It discusses what a microcontroller is and some common types. It then introduces Arduino as an open-source prototyping platform using easy hardware and software. Several Arduino boards are described and the ATmega328p microcontroller chip is specified. The document outlines how to download the Arduino software and write programs. It provides examples of basic Arduino projects like blinking LEDs, reading sensors, and creating sounds.
The Arduino platform allows users to create interactive electronic objects by providing an open-source hardware and software environment. It consists of a microcontroller board and IDE that allows users to write code to control sensors, LEDs, motors and more. The Arduino is inexpensive, easy to use, and has a large community that shares tutorials and projects online. It is well suited for interactive art, design prototypes, and physical computing projects.
This document describes a system for measuring rotational speed using an optical encoder and frequency-to-voltage converter. It includes:
1) An overview of the measurement system, which uses an optical encoder to generate pulses proportional to rotational speed, and a converter to change this frequency to a proportional voltage.
2) Detailed descriptions of the encoder and converter components, including their specifications and operating principles.
3) Diagrams of the encoder internal components and output signals.
4) Information on selecting encoder components based on the desired rotational speed measurement range.
This document outlines an Arduino workshop. It includes an overview of the agenda which involves introductions, checking equipment, experimentation time, and creating personal projects. It then details introducing participants and encouraging collaboration. A list of included parts in the kits is provided. Instructions are given for installing the Arduino software and development environment. Examples are shown for breadboard layouts and code for simple projects like blinking an LED and reading input from a button. Additional experiments suggested include using sensors, LCD displays, motors, and programming an RGB LED with a joystick. Sources for parts, tutorials, and inspiration are listed to encourage continued learning.
This document provides an overview of Arduino programming concepts including:
- The Arduino programming language is based on C/C++ and includes libraries for interfacing with hardware.
- Examples are provided for basic blink programs, using variables, functions, control structures like if statements and loops, reading analog/digital pins, and using the serial monitor.
- Key concepts covered include variable scope, data types, naming conventions, pin modes, analog/digital reading and writing, functions, arrays, and different loop structures.
The document summarizes the basics of Arduino programming. It discusses that Arduino programs have three main parts: structure, values (variables and constants), and functions. It describes the setup() and loop() functions that enclose blocks of code. Setup() initializes variables and runs once, while loop() continuously runs the main program code. It also discusses defining variables, data types, and writing custom functions. Finally, it provides an example of blinking an LED using the Arduino by wiring an LED, resistor and running a program to turn the LED on and off.
This document provides an introduction to an Arduino starter kit, including what is included in the kit and how to use the included book to learn about the Arduino hardware, software, and programming. The kit contains an Arduino Uno board, sensors, displays, and other components. The book guides the user through 16 projects of increasing complexity to teach Arduino skills. It assumes no prior knowledge and provides step-by-step instructions and diagrams to help users build each project and understand how the code and hardware work together.
This document provides an overview of an Arduino workshop that teaches participants about microcontrollers and programming the Arduino board. The workshop introduces key Arduino concepts like sketches, pins, analog and digital signals. It demonstrates basic tasks like blinking LEDs and reading buttons. Participants work with components like breadboards, resistors, potentiometers and LCD displays. The workshop aims to give beginners hands-on experience building circuits to monitor and control processes.
Getting Started With Arduino How To Build A Twitter Monitoring AlertuinoAdrian McEwen
The slides from my talk about Arduino at Barcamp Liverpool. Shows the basics about Arduino and how I hacked a toy gun to fire whenever someone mentioned #bcliverpool on twitter
The document provides an overview of Arduino, including what it is, common Arduino boards, digital and analog input/output, and example projects. Arduino is an open-source electronics prototyping platform that can be used to create interactive objects. It uses a simple hardware and software environment to program and develop prototypes. The Arduino Uno is one of the most commonly used boards, which contains an Atmega328 microcontroller, digital and analog pins, and can be programmed via USB. The document describes how to connect various components like LEDs, buttons, sensors and motors to an Arduino board.
An Arduino guide for beginners.
Topics covered: what is it, use cases examples, microcontrollers vs microprocessors, pins and connections, IDEs, demos.
Class materials for teaching the basic use of Arduino with LED, button, debouncing concept and Serial output. These materials were originally used in Startathon 2016.
The code is available here. https://github.com/SustainableLivingLab/intro-to-arduino
This document describes an Arduino project that uses dip switches and LEDs. The objective is to have an array of 4 dip switches that can be configured by the user in different on/off combinations. The Arduino will continuously read the dip switch values and display the corresponding pattern on an array of 4 LEDs, so the LEDs always indicate the positions of the dip switches. The Arduino code defines the LED and dip switch pins and reads the dip switch input to control the LED output, illuminating the matching LED for each on dip switch. A schematic shows the wiring and a protoboard demonstrates the working circuit. Potential improvements discussed are using smaller dip switches and larger LEDs.
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout BoardRaghav Shetty
This document describes a DIY UNO Play Breadboard that uses an ATmega328p microcontroller. It includes an FT232 breakout board to program the ATmega328p via USB without an onboard USB interface. The breadboard has 14 digital I/O pins, 6 analog inputs, and 6 PWM outputs. An example Arduino code is provided to blink 4 LEDs connected to different digital pins. The breadboard allows prototyping with the common ATmega328p in a similar way to an Arduino UNO board.
Arduino coupled with low cost sensors is an incredible opportunity to mix electronic with Physics and to implement field data collection, IBSE and Home Labs (the other face of fliped classrooms)
This document describes building a digital hourglass circuit using an Arduino that turns on an LED every ten minutes. It includes a list of components, descriptions of how the millis() function keeps track of time and the long data type is used to store larger numbers from millis(). The code explanation shows how to use millis() to check if 10 minutes have passed and turn on the next LED, resetting if the tilt switch changes state.
This document provides an introduction to using Arduino boards. It discusses getting started with the Arduino IDE, programming basics like digital I/O and timing functions. Examples are provided to blink an LED, read a digital sensor, read an analog sensor with a potentiometer, and fade an LED using pulse width modulation. Terminology around bits, bytes and serial communication is also explained. The document aims to teach Arduino fundamentals and provide practice examples for learning.
The document discusses code for Arduino projects involving buttons and LEDs. It provides code for blinking an LED without using delays, as well as code for debouncing a button circuit to avoid erroneous readings from switch noise or bouncing. The debouncing code uses variables to track button states and millis() to measure time between button presses and only register a change after a debounce delay. It also discusses setting up circuits for these projects using an Arduino, breadboard, button, LED, and resistors.
This document provides an overview and introduction to the Arduino software and programming environment through a series of tutorials. It begins by explaining how to download and install the Arduino software and interface. It then demonstrates a basic "Blink" code to turn an LED on and off as an introduction to Arduino programming. The document outlines the various sections of code, such as void setup() and void loop(), and basic syntax like semicolons. It also explains how to upload code to the Arduino board and view the output.
Arduino Workshop Day 1 Slides
Basics of Arduino - Introduction, Basics of Circuits, Signals & Electronics, LED Interfacing, Switch, Buzzer, LCD & Bluetooth Communication.
This document provides an overview of microcontrollers and the Arduino platform. It discusses what a microcontroller is and some common types. It then introduces Arduino as an open-source prototyping platform using easy hardware and software. Several Arduino boards are described and the ATmega328p microcontroller chip is specified. The document outlines how to download the Arduino software and write programs. It provides examples of basic Arduino projects like blinking LEDs, reading sensors, and creating sounds.
The Arduino platform allows users to create interactive electronic objects by providing an open-source hardware and software environment. It consists of a microcontroller board and IDE that allows users to write code to control sensors, LEDs, motors and more. The Arduino is inexpensive, easy to use, and has a large community that shares tutorials and projects online. It is well suited for interactive art, design prototypes, and physical computing projects.
This document describes a system for measuring rotational speed using an optical encoder and frequency-to-voltage converter. It includes:
1) An overview of the measurement system, which uses an optical encoder to generate pulses proportional to rotational speed, and a converter to change this frequency to a proportional voltage.
2) Detailed descriptions of the encoder and converter components, including their specifications and operating principles.
3) Diagrams of the encoder internal components and output signals.
4) Information on selecting encoder components based on the desired rotational speed measurement range.
This document outlines an Arduino workshop. It includes an overview of the agenda which involves introductions, checking equipment, experimentation time, and creating personal projects. It then details introducing participants and encouraging collaboration. A list of included parts in the kits is provided. Instructions are given for installing the Arduino software and development environment. Examples are shown for breadboard layouts and code for simple projects like blinking an LED and reading input from a button. Additional experiments suggested include using sensors, LCD displays, motors, and programming an RGB LED with a joystick. Sources for parts, tutorials, and inspiration are listed to encourage continued learning.
This document provides an overview of Arduino programming concepts including:
- The Arduino programming language is based on C/C++ and includes libraries for interfacing with hardware.
- Examples are provided for basic blink programs, using variables, functions, control structures like if statements and loops, reading analog/digital pins, and using the serial monitor.
- Key concepts covered include variable scope, data types, naming conventions, pin modes, analog/digital reading and writing, functions, arrays, and different loop structures.
The document summarizes the basics of Arduino programming. It discusses that Arduino programs have three main parts: structure, values (variables and constants), and functions. It describes the setup() and loop() functions that enclose blocks of code. Setup() initializes variables and runs once, while loop() continuously runs the main program code. It also discusses defining variables, data types, and writing custom functions. Finally, it provides an example of blinking an LED using the Arduino by wiring an LED, resistor and running a program to turn the LED on and off.
This document provides an introduction to an Arduino starter kit, including what is included in the kit and how to use the included book to learn about the Arduino hardware, software, and programming. The kit contains an Arduino Uno board, sensors, displays, and other components. The book guides the user through 16 projects of increasing complexity to teach Arduino skills. It assumes no prior knowledge and provides step-by-step instructions and diagrams to help users build each project and understand how the code and hardware work together.
This document provides an overview of an Arduino workshop that teaches participants about microcontrollers and programming the Arduino board. The workshop introduces key Arduino concepts like sketches, pins, analog and digital signals. It demonstrates basic tasks like blinking LEDs and reading buttons. Participants work with components like breadboards, resistors, potentiometers and LCD displays. The workshop aims to give beginners hands-on experience building circuits to monitor and control processes.
Getting Started With Arduino How To Build A Twitter Monitoring AlertuinoAdrian McEwen
The slides from my talk about Arduino at Barcamp Liverpool. Shows the basics about Arduino and how I hacked a toy gun to fire whenever someone mentioned #bcliverpool on twitter
The document provides an overview of Arduino, including what it is, common Arduino boards, digital and analog input/output, and example projects. Arduino is an open-source electronics prototyping platform that can be used to create interactive objects. It uses a simple hardware and software environment to program and develop prototypes. The Arduino Uno is one of the most commonly used boards, which contains an Atmega328 microcontroller, digital and analog pins, and can be programmed via USB. The document describes how to connect various components like LEDs, buttons, sensors and motors to an Arduino board.
An Arduino guide for beginners.
Topics covered: what is it, use cases examples, microcontrollers vs microprocessors, pins and connections, IDEs, demos.
Class materials for teaching the basic use of Arduino with LED, button, debouncing concept and Serial output. These materials were originally used in Startathon 2016.
The code is available here. https://github.com/SustainableLivingLab/intro-to-arduino
This document describes an Arduino project that uses dip switches and LEDs. The objective is to have an array of 4 dip switches that can be configured by the user in different on/off combinations. The Arduino will continuously read the dip switch values and display the corresponding pattern on an array of 4 LEDs, so the LEDs always indicate the positions of the dip switches. The Arduino code defines the LED and dip switch pins and reads the dip switch input to control the LED output, illuminating the matching LED for each on dip switch. A schematic shows the wiring and a protoboard demonstrates the working circuit. Potential improvements discussed are using smaller dip switches and larger LEDs.
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout BoardRaghav Shetty
This document describes a DIY UNO Play Breadboard that uses an ATmega328p microcontroller. It includes an FT232 breakout board to program the ATmega328p via USB without an onboard USB interface. The breadboard has 14 digital I/O pins, 6 analog inputs, and 6 PWM outputs. An example Arduino code is provided to blink 4 LEDs connected to different digital pins. The breadboard allows prototyping with the common ATmega328p in a similar way to an Arduino UNO board.
Arduino coupled with low cost sensors is an incredible opportunity to mix electronic with Physics and to implement field data collection, IBSE and Home Labs (the other face of fliped classrooms)
This document describes building a digital hourglass circuit using an Arduino that turns on an LED every ten minutes. It includes a list of components, descriptions of how the millis() function keeps track of time and the long data type is used to store larger numbers from millis(). The code explanation shows how to use millis() to check if 10 minutes have passed and turn on the next LED, resetting if the tilt switch changes state.
The document describes how to build a spaceship interface circuit using an Arduino. It includes instructions to wire an LED circuit with a switch and write an Arduino program to control the LEDs based on the switch state. When the switch is open a green LED will be on, and when closed the green LED will turn off and two red LEDs will start blinking by changing states with a delay. The program uses variables, if/else statements, and functions like digitalRead(), digitalWrite(), and delay().
This document provides instructions for fading an LED on and off using an Arduino board and the analogWrite() function. It requires an Arduino board, LED, 220 ohm resistor, hook-up wires, and breadboard. The circuit connects the LED anode through a resistor to a digital pin, with the cathode to ground. The code uses analogWrite() to gradually increase or decrease the brightness from 0 to 255 to fade the LED on and off over time.
A Fast Introduction to Arduino and Addressable LED Stripsatuline
The document provides an introduction to using Arduino and addressable LED strips. It discusses addressable LED strips and how each LED can be controlled individually. It introduces the FastLED library for efficiently programming LED strips and describes how to set up and run basic examples like making a rainbow pattern march across the strip. It also discusses more advanced FastLED features and includes additional resources.
This laboratory manual introduces students to controlling systems using an Arduino microcontroller. Lab 1 covers basic input and output using LEDs and buttons. Lab 2 adds a photoresistor sensor and implements proportional and proportional-integral control of LED brightness. Lab 3 applies these same control techniques to a motor system using an encoder for position feedback. The labs provide circuit diagrams, code examples, and instructions to help students gather and analyze data on system responses under different control schemes.
Arduino - Ch 2: Sunrise-Sunset Light SwitchRatzman III
The document describes how to build a Sunrise-Sunset Light Switch using an Arduino microcontroller. The circuit uses a photocell to detect light instead of a pushbutton. When light is detected, a red LED turns on. After a few seconds determined by an RC timing circuit, the red LED turns off and a green LED turns on. The circuit diagram and code are provided to build the project. Modifications to the code allow status messages to display on the serial monitor.
This document provides instructions on how to write reliable timers and delays in Arduino without using the delay() function, which causes the system to pause while waiting. It introduces the elapsedMillis library for creating repeating and one-time timers. It then discusses alternatives that do not require this library, including examples of a repeating timer and single-shot timer using millis(). The document warns of issues with approaches that rely on millis() overflowing after 50 days and recommends using elapsed time comparisons instead of absolute times to ensure reliability. It emphasizes the importance of the loop() executing frequently enough.
IoT Basics with few Embedded System Connections for sensorssaritasapkal
This document provides information about a two-day workshop on IoT and embedded systems. The workshop will cover topics such as what IoT is, applications of IoT, Arduino, microcontrollers, sensors like LM35 and MQ2, programming with Arduino, and examples of coding for tasks like blinking an LED and reading from temperature and gas sensors. Hands-on sessions are included to allow participants to work with the Arduino development board, sensors, and programming.
The document provides an overview of topics related to interfacing sensors and actuators with Arduino microcontrollers. It discusses basic I/O components, sensor interfacing including ultrasonic, IR, temperature and motion sensors. It also covers actuators, motor control, LCD displays and programming concepts for Arduino like digital and analog I/O, PWM and interrupts. References for further reading on Arduino programming are also provided.
This document describes how to use pulse width modulation (PWM) to fade an LED's brightness level in and out with a microcontroller. PWM works by varying the duty cycle of digital pulses sent to the LED, which the eye perceives as varying brightness. To achieve a smooth fade, logarithmic values are used for the duty cycle since LED brightness increases logarithmically. The circuit uses a PIC microcontroller to generate the PWM signal controlling an LED via a transistor. Software increments through logarithmic brightness values to fade the LED in and out over time.
The introduction to Arduino labs at Malmö University. These slides have been handed down since the beginning of Arduino. They have more authors then i can remember and should by no means be considered mine.
The introduction to Arduino labs at Malmö University. These slides have been handed down since the beginning of Arduino. They have more authors then i can remember and should by no means be considered mine.
Instrument Project
Refrigeration And Air Conditioning Engineer - State Polytechnic of Bandung
2A-Grup 2
Ricky Jordan Antono (151611024)
Farid G (151611010)
Arisa T (151611005)
more information :
rickyjordan399@gmail.com
In general, to carry out life people living in rural livelihood as farmers. Farming is already ingrained and carried down-temurun.Pertanian have become everyday activities, especially for people who live near these communities pegunungan.Perekonomian largely dependent on agriculture. Sometimes farmers do not always yield a good crop, due to crop failure
Plants that have failed to bear fruit one being a contributing factor is something is distorted or there is something wrong during the process of planting. One is a plant that is less than optimal in the sunlight, then the process of photosynthesis is not running optimally. This results in the photosynthesis that produces carbohydrates. As a result, accumulation of carbohydrates to be not optimal so that interest is formed into little or even none at all (quoted in Argoteknologi.Web.id)
By addressing this we made a prototype device that utilizes Commucations Global System for Mobile (GSM) standard which is one of the wireless communication system (wireless) which is open. In this case been the subject of green house.
it can be concluded that the freehand tool is expected to be used to control lights as a substitute for the lack of sunlight in the process of photosynthesis, so the quantity and quality of crop production in the greenhouse can be increased as optimally as possible. In this case, we limit only on the micro climate and temperature indicator light only. This was chosen because it is considered the second most easy to be controlled and matched to the system Green House.
In general, to carry out life people living in rural livelihood as farmers. Farming is already ingrained and carried down-temurun.Pertanian have become everyday activities, especially for people who live near these communities pegunungan.Perekonomian largely dependent on agriculture. Sometimes farmers do not always yield a good crop, due to crop failure
Plants that have failed to bear fruit one being a contributing factor is something is distorted or there is something wrong during the process of planting. One is a plant that is less than optimal in the sunlight, then the process of photosynthesis is not running optimally. This results in the photosynthesis that produces carbohydrates. As a result, accumulation of carbohydrates to be not optimal so that interest is formed into little or even none at all (quoted in Argoteknologi.Web.id)
By addressing this we made a prototype device that utilizes Commucations Global System for Mobile (GSM) standard which is one of the wireless communication system (wireless) which is open. In this case been the subject of green house.
it can be concluded that the freehand tool is expected to be used to control lights as a substitute for the lack of sunlight in the process of photosynthesis, so the quantity and quality of crop production in the greenhouse can be increased as optimally as possible. In this case, we limit only on the micro climate and temperature indicator light only. This was chosen because it is considered the second most easy to be controlled and matched to the system Green House.
Twin wheeler modified for arduino simplified serial protocol to sabertooth v22josnihmurni2907
This document provides code for a self-balancing two-wheeled robot (twin wheeler) modified to use a simplified serial protocol to control motors with an Arduino and Sabertooth motor controller. The code samples sensor inputs, runs control algorithms to maintain balance, and outputs motor control signals. It has been updated over time with improvements like a softer startup sequence, improved deadman switch functionality, and optional steering controls.
Twin wheeler modified for arduino simplified serial protocol to sabertooth v21josnihmurni2907
This document describes code for controlling a self-balancing skateboard or robot using an Arduino board and a Sabertooth motor controller. It includes sections to initialize communication with the Sabertooth, sample sensor inputs from an IMU, apply filtering to the accelerometer data, and calculate steering commands based on gyroscope readings to maintain balance and allow for user steering input. The code is intended to balance the device and allow it to be steered either straight or in a turn with adjustable resistance to deviations from the desired heading.
Twin wheeler modified for arduino simplified serial protocol to sabertooth v2josnihmurni2907
This Arduino code modifies a twin-wheeled robot to use a Sabertooth motor controller with a simplified serial protocol. It tests communication between the Arduino, Sabertooth, and motors. A deadman switch cuts power if released for safety. The motors gradually increase in speed from 0-50% of full power over 5 seconds, then decrease from 50-0% over 5 more seconds in a continuous loop. Both wheels must spin at the same speed and direction or the robot will not drive straight.
This Arduino code measures the time interval between a pin going high and another pin going low. It waits for pin 4 to go high, starts a timer, lights an LED, then waits for pin 5 to go low, stops the timer, and reports the elapsed time in microseconds. The code provides a simple way to time events and can reliably measure intervals down to about 60 microseconds.
This document contains the code for a sigh collector receiver module. It defines variables to control an LED, pump, and reading value. It initializes serial communication and sets the pumpRunning and stepCounter variables. The main loop handles serial data, checks if the pump should start or stop based on the stepCounter and time thresholds, and debounces the button input. Additional functions start and stop the pump by controlling the LED and pump pins.
This code is used to detect sighs from a patient and send a signal to a mobile device. It reads analog sensor data to calculate a sliding average breath value and compare it to a threshold. When the average exceeds the threshold for a possible sigh, it monitors for the average to drop below a level to confirm the sigh. Upon detection, it sends a signal over a serial connection and lights an LED for one second.
The document defines constants for the bit patterns of various alphanumeric characters and symbols using hexadecimal values. It then defines arrays to store these patterns and functions to display the patterns on a 7-segment display by shifting the bit patterns and latching them to the display driver. When serial data is received, the appropriate character patterns are copied to a display array which is then scrolled on the display using the defined functions.
The document defines constants for binary representations of letters, numbers, and punctuation symbols. It then defines functions for displaying these symbols on a scrolling LED display using shift registers and SPI communication. The main loop calls the display function to scroll the text "HI WORLD" across the LED display.
Call and message using arduino and gsm modulejosnihmurni2907
This document describes building a simple mobile phone using an Arduino, GSM module, keypad, LCD display, speaker, and microphone. The phone can make and receive calls, and send and receive SMS messages. The GSM module handles the cellular connectivity, while the Arduino controls interfacing with the components and sending AT commands to the GSM module to perform phone functions. An alphanumeric keypad is used for input, and a LCD displays messages, instructions, and call/SMS information.
This document provides an overview of timers and interrupts on Arduino boards. It explains what timers and interrupts are, how the different timers on Arduino boards like the Uno and Mega work, and how to configure and use them. It includes examples of blinking an LED using a timer compare match interrupt and generating PWM signals using timers. Common libraries that use timers like the Servo library are also discussed alongside potential issues when using timers and interrupts.
The document contains 13 math problems involving functions. The problems cover topics such as:
- Finding the image and object of elements under a given function
- Finding inverse functions
- Determining the type of relation between sets
- Evaluating composite functions
- Solving for unknown constants in function definitions
- Finding the value of x when a composite function equals a given value
The document provides the problems and blank spaces for the answers. The answers section gives the solutions to each of the 13 problems.
(i) Rangkaian tahunan matematika untuk tingkatan 5 SMK Taman Indah membincangkan topik-topik seperti asas nombor, graf fungsi, penjelmaan dan matriks. (ii) Topik-topik ini akan diajar selama 13 minggu dan diikuti dengan ujian selaras pada minggu ke-11 dan ke-18. (iii) Aktiviti pembelajaran terdiri daripada perbincangan kelas, projek, dan penggunaan perisian seperti Geometer's Sketchpad.
Dokumen tersebut memberikan 10 cara untuk menghilangkan rasa ngantuk di kelas, termasuk berjemur, olahraga ringan, minum teh hijau, berjalan, bernapas dalam, dan olahraga rutin. Tujuannya adalah meningkatkan aliran darah dan oksigenasi otak untuk menjaga fokus dan konsentrasi selama pelajaran.
Bandar purba berukuran 62 padang bola sepak ditemui terletak 26-40 meter di bawah permukaan Tasik Qiandao di China, dibina pada abad ke-3 Masehi dan menjadi tapak menyelam popular.
Dokumen tersebut merangkum 12 kaum yang dibinasakan Allah menurut Alquran karena mengingkari utusan-Nya, termasuk kaum Nabi Nuh, Nabi Hud, Nabi Saleh, Nabi Luth, Nabi Syuaib, Firaun, Ashab Al-Sabt, Ashab Al-Rass, Ashab Al-Ukhdud, Ashab Al-Qaryah, Kaum Tubba' dan Kaum Saba. Mereka dihukumi dengan berbagai azab seperti banjir, angin kencang,
This document contains a summary of the key points to address in answering additional mathematics questions from a 2015 SPM exam. It includes 24 questions covering topics like functions, vectors, probability, calculus, and statistics. For each question, it lists the correct answer or working, identified with a check mark. It provides guidance on acceptable versus unacceptable responses. The summary aims to help students understand the essential information and logical reasoning required to solve additional math problems.
Physiology and chemistry of skin and pigmentation, hairs, scalp, lips and nail, Cleansing cream, Lotions, Face powders, Face packs, Lipsticks, Bath products, soaps and baby product,
Preparation and standardization of the following : Tonic, Bleaches, Dentifrices and Mouth washes & Tooth Pastes, Cosmetics for Nails.
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
Assessment and Planning in Educational technology.pptxKavitha Krishnan
In an education system, it is understood that assessment is only for the students, but on the other hand, the Assessment of teachers is also an important aspect of the education system that ensures teachers are providing high-quality instruction to students. The assessment process can be used to provide feedback and support for professional development, to inform decisions about teacher retention or promotion, or to evaluate teacher effectiveness for accountability purposes.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
1. Arduino - multiple LEDs with differentdelays
muteprint Mar 4, 2013 1:56 AM
Hi all
I'm tryingto write code to get 3 LEDs flashing independently, each with a different ON and OFF
period.
For example:
LED1: ON for 25 ms, OFF for 500 ms
LED2: ON for 50 ms, OFF for 800 ms
LED3: ON fo 100 ms, OFF for 300 ms
So far I have set up the hardware: 3 LEDs on digital pins6, 7 and 8 using myArduino UNOboard and
a breadboard.
Code-wise I understand that I can't use the "delay" function because it causes the whole system to
delayi.e. causes 'blocking'. At the moment I'm using the millis() function. My problem is that at the
moment my code causes LED1 to turn ON for 25 ms and off for 25 ms, LED2 turnsON for 50 ms and
off for 50 ms etc. So I need to somehow alter the OFF period independently.
In summary: I need a new approach or an alteration to my code to be able to independentlychange
the ON and OFF periods for each of myLEDs independently.
Here is my code so far:
[code]
// Which pins are connected to which LED
const byte LED1 = 6;
const byte LED2 = 7;
const byte LED3 = 8;
// Assigningdelays.
const unsigned long LED1_interval = 25;
const unsigned long LED2_interval = 50;
const unsigned long LED3_interval = 100;
// Declaringthe variablesholdingthe timer values for each LED.
unsigned long LED1_timer;
unsigned long LED2_timer;
unsigned long LED3_timer;
// Setting3 digital pinsas output pins and resettingtimer
void setup ()
{
pinMode (LED1, OUTPUT);
pinMode (LED2, OUTPUT);
2. pinMode (LED3, OUTPUT);
LED1_timer = millis();
LED2_timer = millis();
LED3_timer = millis();
} // end of setup
//LED1 loop that turnsit ON if it is OFF and vice versa
void toggle_LED1 ()
{
if (digitalRead (LED1) == LOW)
digitalWrite (LED1, HIGH);
else
digitalWrite (LED1, LOW);
// remember when we toggled it
LED1_timer = millis();
} // end of toggleLED_1
//LED2 loop
void toggle_LED2 ()
{
if (digitalRead (LED2) == LOW)
digitalWrite (LED2, HIGH);
else
digitalWrite (LED2, LOW);
// remember when we toggled it
LED2_timer = millis();
} // end of toggle_LED2
//LED 3 loop
void toggle_LED3 ()
{
if (digitalRead (LED3) == LOW)
digitalWrite (LED3, HIGH);
else
digitalWrite (LED3, LOW);
// remember when we toggled it
LED3_timer = millis();
} // end of toggle_LED3
void loop ()
{
// Handlingthe blink of LED1.
if ( (millis() - LED1_timer)>= LED1_interval)
toggle_LED1 ();
3. // Handlingthe blink of LED2.
if ( (millis() - LED2_timer)>= LED2_interval)
toggle_LED2 ();
// Handlingthe blinkof LED3.
if ( (millis() - LED3_timer)>= LED3_interval)
toggle_LED3 ();
/* Other code that needsto execute goes here.
It will be called manythousand timesper second because the above code
does not wait for the LED blinkinterval to finish. */
} // end of loop
[/code]
Any help would be greatlyappreciated because I'm [b]very[/b]new to this!
Thanks!
I have the same question (0)
24908 Views
Tags:
Reply
Re: Arduino - multiple LEDs with different delays
billabott Mar 4, 2013 7:29 AM (inresponseto muteprint)
Most Arduino boards have two external interrupts: numbers 0 (on digital pin 2) and 1 (on digital pin 3).
Official Arduino.cc Example
int pin = 13;
volatile int state = LOW;
void setup()
{
pinMode(pin, OUTPUT);
attachInterrupt(0, blink, CHANGE); //0 is digtal pin 2
}
void loop()
{
digitalWrite(pin, state);
}
void blink()
{
state = !state;
}
4. Observing that all your time factors are multiples of 25 ms, I would suggest
that you usea digital pin on your UNOto initiate a self generated external
interrupt.
Addingcode: const byte iSignal =9;
Addingphysical wire/resister+LED/cap. between pins 9 and 2.
Here is the guts of it: pin 9 is pulsed every 25 msby your loop(), the
iHandler() bumps a counter, the main loop() has a case statement that
allows the required LED transistion actions to take place dependingon the
counter valueonly when old_counter is not equal to counter.
0 <= counter <= 32 (because 800/25=32), resetcounter to 0 after 32
interrupts have occurred. (I am not sureif you want to countto 32 or 31.)
To make the implementation easier(reliable) change
LED1: ON for 25 ms,OFF for 500 ms
LED2: ON for 50 ms,OFF for 800 ms
to
LED1: ON for 25 ms,OFF for 450 ms
LED2: ON for 50 ms,OFF for 750 ms
FYI: http://arduino.cc/en/Reference/AttachInterrupt
Then again, you could just call the iHandler directly withoutthe external
interrupt - but what fun would that be?
o Like (0)
o Reply
o Actions
o Re: Arduino - multiple LEDs with different delays
muteprint Mar 4, 2013 7:00 AM (inresponseto billabott)
Thank you very much for replyingso quicklybillabot. Unfortunately there will be times when I need
to LED to flash 3 timesa second i.e. with an interval of 333ms, so not everythingwill be divisble by
25. Is your method adaptable to any value?
I've been working on thistonight and made a few alterationsto my code. I thinkI'm going in the
right direction with the method I've chosen.
• Defined seperate ON and OFF intervalsfor each LED
• Adapted my loops to use both the OFF and ON intervals.
5. Unfortunately I've ended gettingmyself reallyconfused and now myLEDs seem to sometimesflash
the OFF interval, sometimeswith the ON and sometimeswith a combination of the both.
Any idea how I've gone so badlywrong?
I hope I'm slowly moving in the right direction. If not I might have to try a different approach like
usingthe interupt function. I am very new to the Arduino and writingcode of any sort, so that
approach seems quite dauntingto me.
Below is myaltered code.
[code]
//DEFINING CONSTANTS& VARIABLES
// Which pinsare connected to which LED
const byte LED1 = 6;
const byte LED2 = 7;
const byte LED3 = 8;
// AssigningON and OFF interval constants.
const unsigned long LED1_ON_interval = 3000; //
const unsigned long LED1_OFF_interval = 6000;
const unsigned long LED2_ON_interval = 500; //
const unsigned long LED2_OFF_interval = 1000;
const unsigned long LED3_ON_interval = 100; //
const unsigned long LED3_OFF_interval = 3000;
// Declaringthe variablesholdingthe timer value, i.e. time of last state change.
unsigned long LED1_statechange_Timei;
unsigned long LED2_statechange_Timei;
unsigned long LED3_statechange_Timei;
unsigned long LED1_statechange_Timeii;
unsigned long LED2_statechange_Timeii;
unsigned long LED3_statechange_Timeii;
//SETUP
// Setting3 digital pinsas LED output pins and startingmillisecond timer
void setup ()
{
pinMode (LED1, OUTPUT);
pinMode (LED2, OUTPUT);
pinMode (LED3, OUTPUT);
LED1_statechange_Timei= millis();
LED2_statechange_Timei= millis();
LED3_statechange_Timei= millis();
} // end of setup
6. //LOOPS 1
// LED1 loop that turns LEDON if it is OFF
void toggle_LED1i ()
{
if (digitalRead (LED1) == LOW)
digitalWrite (LED1, HIGH);
LED1_statechange_Timei= millis(); // Remember when LED1'sstate waschanged from ON to
OFF
} // End of toggle_LED1i
// LED1 loop that turns LEDOFF if it is ON
void toggle_LED1ii ()
{
if (digitalRead (LED1)== HIGH);
digitalWrite (LED1, LOW);
LED1_statechange_Timei= millis(); // Remember when LED1'sstate waschanged from OFF to
ON
} // End of toggle_LED1ii
// LED2 loop that turns LEDON if it is OFF
void toggle_LED2i ()
{
if (digitalRead (LED2) == LOW)
digitalWrite (LED2, HIGH);
LED2_statechange_Timeii= millis(); // Remember when LED2'sstate was changed from ON to
OFF
} // End of toggle_LED2i
// LED2 loop that turns LEDOFF if it is ON
void toggle_LED2ii ()
{
if (digitalRead (LED2)== HIGH);
digitalWrite (LED2, LOW);
LED2_statechange_Timeii= millis(); // Remember when LED2'sstate waschanged from OFF to
ON
} // End of toggle_LED2ii
7. // LED3 loop that turns LEDON if it is OFF
void toggle_LED3i ()
{
if (digitalRead (LED3) == LOW)
digitalWrite (LED3, HIGH);
LED3_statechange_Timei= millis(); // Remember when LED3'sstate waschanged from ON to
OFF
} // End of toggle_LED2i
// LED3 loop that turns LEDOFF if it is ON
void toggle_LED3ii ()
{
if (digitalRead (LED3)== HIGH);
digitalWrite (LED3, LOW);
LED3_statechange_Timeii= millis(); // Remember when LED3'sstate waschanged from OFF to
ON
} // End of toggle_LED3ii
//LOOPS 2
void loop () // Start of loop
{
//LED 1
// If the time since the last change in state from OFF to ON is equal or greater than the ON
interval
//then run the loop toggle_LED1i
if ( (millis() - LED1_statechange_Timei)>= LED1_ON_interval)
toggle_LED1i ();
// If the time since the last change in state from ON to OFF is equal or greater than the OFF
interval
//then run the loop toggle_LED1ii
if ( (millis() - LED1_statechange_Timeii)>= LED1_OFF_interval)
toggle_LED1ii ();
//LED 2
// If the time since the last change in state from OFF to ON is equal or greater than the ON
interval
//then run the loop toggle_LED2i
if ( (millis() - LED2_statechange_Timei)>= LED2_ON_interval)
toggle_LED2i ();
// If the time since the last change in state from ON to OFF is equal or greater than the OFF
interval
//then run the loop toggle_LED2ii
8. if ( (millis() - LED2_statechange_Timeii)>= LED2_OFF_interval)
toggle_LED2ii ();
//LED 3
// If the time since the last change in state from OFF to ON is equal or greater than the ON
interval
//then run the loop toggle_LED3i
if ( (millis() - LED3_statechange_Timei)>= LED3_ON_interval)
toggle_LED3i ();
// If the time since the last change in state from ON to OFF is equal or greater than the OFF
interval
//then run the loop toggle_LED2ii
if ( (millis() - LED3_statechange_Timeii)>= LED3_OFF_interval)
toggle_LED3ii ();
} // End of loop
[/code]
Thanks!
Like (0)
Reply
Actions
Re: Arduino - multiple LEDs with different delays
billabott Mar 7, 2013 1:15 PM (in responseto muteprint)
Sorry, no, I am out of ideas. I will, however, share with you that there are other uC that have multiple
timerson board that can be configured to generate interruptsat anypredetermined interval.
Q: Just out of curiosity, what exactlycontrols the periodicityof your LEDs?
Or in other words; "What isyour application, eh?"
You might simplify your program by adoptinga more conventional approach by using
boolean LED1_state = false; // place these very near the top of script so their scopes are GLOBAL
boolean LED2_state = false;
boolean LED3_state = false;
If time to turn off LED1
Set LED1_on_timer to milles()+800; // turningoff; so it is known when to turn it on again.
toggle_LED(&LED1, &LED1_state); // call function to toggle LED between 1 and 0
Set LED1_off_timer to milles() +2048; // presumeablywill be reset to a correct value
// after turningLED1 on prior to the expiration of this value
else if time to turn on LED1
Set LED1_off_timer to milles() +50; // turningon; so it is known when to turn it off again.
toggle_LED(&LED1, &LED1_state);; // call function to toggle LED between 0 and 1
Set LED1_on_timer to milles()+2048; // presumeablywill be reset to a correct value
// after turningLED1 off prior to the expiration of this value
9. void toggle_LED(int *LEDxP, boolean *LEDxP_state) // will need ONLY this one function to toggle ANY LED
since pointers are used
{
digitalWrite (*LEDxP, (*LEDxP_state = !(*LEDxP_state))); // see note below
} // End of toggle_LED
note: According to http://arduino.cc/en/Reference/BooleanVariables
digitalWrite does accept boolean arg of true/false in lieu of HIGH/LOW arg.
Message was edited by: William Bottger
Like (0)
Reply
Actions
Re: Arduino - multiple LEDs with different delays
coder27 Mar 5, 2013 12:47 AM (inresponse to billabott)
Even with using only one timer, you may be able to do somethinglike this:
You have 6 eventsto schedule (turningeach of 3 LED's On and Off).
For each event, you need to store 4 fields: which LED, On vs. Off,
the time-of-daythe event should be taken next, and the amount of time
between events. For LED1, the time between eventswould be 525 ms.
You can store these 6 events in an array. (They don't have to be sorted
in any particular order.) It may help to thinkof thisarray as the "delay-queue"
of a task scheduler.
Then you can write a function that will scan this arrayand find the event with the
soonest next time-of-day. Set an interrupt timer for that time-of-day. While
waitingfor the timer, any work can be going on. When the timer goes off,
turn the specified LED On or Off, and update the next time-of-dayfield by adding
the specified time between eventsfor that LED. Loop back and scan the array
again to find the next soonest event.
Like (0)
Reply
Actions
Re: Arduino - multiple LEDs with different delays
coder27 Mar 12, 2013 3:04 PM (inresponseto muteprint)
Hi muteprint,
I looked a little closer at your code, and see a few problems:
In toggle_LED1ii()
you have:
LED1_statechange_Timei= millis (); // Remember when LED1'sstate was changed from OFF to
ON
but that should be Timeii (two i's).
Similarly, in toggle_LED2i ()
you have:
10. LED2_statechange_Timeii= millis(); // Remember when LED2'sstate was changed from ON to
OFF
but that should be Timei (one i).
Also, in setup(), I think you need to initialize the Timeii statechange variables, in order to prevent
referring
to random valuesin the loops.
Billabott is probablyright that by usingpointers you can condense the code, but I haven't
looked at that closely, and I thinkyou probablywant to get it working first, and then improve it later.
Like (0)
Reply
Actions
Re: Arduino - multiple LEDs with different delays
billabott Mar 7, 2013 12:47 PM (in responseto muteprint)
unsigned long Timer // "ALWAYSuse unsigned long for timers, not int"
// (variable declaration outside setup and loop, of course)
// makes the Timer var GLOBAL in scope
That is good advice from http://playground.arduino.cc/Code/AvoidDelay
Please check out mymodified code above for pointer ref. & deref. usage!
Code in previouspost updated based on the following experiment which does compile and run
correctly!
boolean ON = HIGH;
boolean OFF = LOW;
boolean led1 = ON;
void setup()
{ //led1 = OFF;
pinMode(13, OUTPUT);
}
void loop()
{ test(&led1);
digitalWrite(13, led1);
delay(1500);
}
void test(boolean *varLED)
{ *varLED= !(*varLED);
}
This Arduinosketch was programmed byWilliam A T Bottger.
Message was edited by: William A T Bottger