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: Serial Navigator
- - Source Code NOT compiled for: Arduino Pro Mini 5V
- - Source Code created on: 2025-09-28 13:27:30
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* Make a Personal Portfolio Website */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h> // Arduino core
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- void printSection(int idx);
- void initPortfolio();
- /* Pin definitions for portfolio navigation */
- const int BUTTON_PIN = 2; // Next section button
- const int LED_PIN = 13; // Built-in LED for feedback
- const int NUM_SECTIONS = 4;
- const char* section_titles[NUM_SECTIONS] = {
- "About Me",
- "Projects",
- "Skills",
- "Contact"
- };
- // state
- int currentSection = 0;
- bool buttonState = HIGH;
- bool lastButtonState = HIGH;
- unsigned long lastDebounceTime = 0;
- const unsigned long debounceDelay = 50; // milliseconds
- /*
- Prints the content for the given portfolio section on the Serial Monitor.
- This emulates a simple textual portfolio view suitable for plain serial output.
- */
- void printSection(int idx){
- Serial.println();
- Serial.println("=================================");
- Serial.print("Section: ");
- Serial.println(section_titles[idx]);
- Serial.println("---------------------------------");
- switch(idx){
- case 0:
- Serial.println("Hello! I'm a passionate embedded systems developer.");
- Serial.println("I create Arduino-based prototypes, wearable electronics, and IoT demos.");
- Serial.println("Key focus: reliability, clean code, and compact hardware design.");
- Serial.println("Experience: C/C++, AVR, debugging, and problem solving.");
- break;
- case 1:
- Serial.println("Projects:");
- Serial.println("- Sensor Logger: collects data from peripherals (demo)." );
- Serial.println("- LED Matrix Demo: displays patterns on a small LED matrix.");
- Serial.println("- Button Studio: interactive UI with a push button and serial output.");
- break;
- case 2:
- Serial.println("Skills:");
- Serial.println("C/C++, Arduino programming, Microcontroller peripherals, Debugging.");
- Serial.println("Electronics, soldering, and PCB design fundamentals.");
- break;
- case 3:
- Serial.println("Contact:");
- Serial.println("Website: not provided in this demo");
- break;
- default:
- Serial.println("Welcome to the personal portfolio simulation.");
- break;
- }
- Serial.println("=================================");
- Serial.println();
- }
- void initPortfolio(){
- // Initialize Serial and pins
- Serial.begin(115200);
- // Allow time for Serial Monitor to initialize
- delay(2000);
- pinMode(BUTTON_PIN, INPUT_PULLUP);
- pinMode(LED_PIN, OUTPUT);
- digitalWrite(LED_PIN, LOW);
- // show initial section
- currentSection = 0;
- printSection(currentSection);
- }
- void setup(void)
- {
- // put your setup code here, to run once:
- initPortfolio();
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- int reading = digitalRead(BUTTON_PIN);
- if (reading != lastButtonState) {
- lastDebounceTime = millis();
- lastButtonState = reading;
- }
- if ((millis() - lastDebounceTime) > debounceDelay) {
- if (reading == LOW && buttonState == HIGH) {
- // button pressed
- buttonState = LOW;
- currentSection = (currentSection + 1) % NUM_SECTIONS;
- Serial.println();
- digitalWrite(LED_PIN, HIGH);
- delay(50);
- digitalWrite(LED_PIN, LOW);
- printSection(currentSection);
- } else if (reading == HIGH) {
- buttonState = HIGH;
- }
- }
- // minimal loop delay to avoid flooding serial with prints
- delay(10);
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment