Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: **LED Buzzer**
- - Source Code NOT compiled for: Arduino Uno
- - Source Code created on: 2024-11-04 14:03:35
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* activate led */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- void updateOutputs(void);
- /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
- const uint8_t led_LED_PIN_D2 = 2;
- const uint8_t buzz_ActiveBuzzer_output_PIN_D3 = 3;
- /***** DEFINITION OF PWM OUTPUT PINS *****/
- const uint8_t out_PIN_D5 = 5;
- /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
- /***** used to store raw data *****/
- bool led_LED_PIN_D2_rawData = 0;
- bool buzz_ActiveBuzzer_output_PIN_D3_rawData = 0;
- uint8_t out_PIN_D5_rawData = 0;
- /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
- /***** used to store data after characteristic curve transformation *****/
- float led_LED_PIN_D2_phyData = 0.0;
- float buzz_ActiveBuzzer_output_PIN_D3_phyData = 0.0;
- float out_PIN_D5_phyData = 0.0;
- void setup(void)
- {
- // put your setup code here, to run once:
- pinMode(led_LED_PIN_D2, OUTPUT);
- pinMode(buzz_ActiveBuzzer_output_PIN_D3, OUTPUT);
- pinMode(out_PIN_D5, OUTPUT);
- // Activate the LED by setting its raw data to HIGH
- led_LED_PIN_D2_rawData = 1; // Set to HIGH to turn on the LED
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- updateOutputs(); // Refresh output data
- }
- void updateOutputs()
- {
- digitalWrite(led_LED_PIN_D2, led_LED_PIN_D2_rawData);
- digitalWrite(buzz_ActiveBuzzer_output_PIN_D3, buzz_ActiveBuzzer_output_PIN_D3_rawData);
- analogWrite(out_PIN_D5, out_PIN_D5_rawData);
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement