Esp8266 code conversion

Hello all

I found online a pice of code thar does exectly what i need it to do but it only runs on a ESP8266, thing that i don't have.

Question:
Can anyone help me convert it to work with my Uno ??

Thank you in advanced
Xmodpt

/*
 * Curing station source code.  
 *  
 *  Up = 271
 *  Down = 460
 *  Left = 715
 *  Right = 896
 *  Press = 1024
 *  
 */
 
#include <Wire.h>
#include "OLED.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>


/*************************************
 * AD-value for 5-way tactile joystick connected to different resistors.
 */

#define button_up 271
#define button_down 
#define button_left 715
#define button_right 896
#define button_press A0


/*************************************
 * Pin settings
 */

#define uvlight 14
#define led 13
#define motor 12
#define button A0

OLED display(4, 5);

bool menuActive = false;
bool sequence_active = false;

int val;
int len;
char text[20];
int text_size;
int value = 0;
int time_setting1 = 300;
int time_setting2 = 600;
int time_setting3 = 900;

int time_counter = 0;
int time_display_minutes = 0;
int time_display_seconds = 59;
int active_menuitem = 1;

/*************************************
 * PWM Pre-sets
 */

int motor_pwm = 600;
int uvlight_pwm = 1023;


void setup() {
  //Serial.begin(115200);
  //Serial.println("Serial port debug");
  
  pinMode(uvlight, OUTPUT);
  pinMode(motor, OUTPUT);
  pinMode(button, INPUT);
  pinMode(led, OUTPUT);

  // Initialize display
  
  display.begin();
  display.off();
  display.on();
  display.print("  Curingbox V1", 1, 0);

  display.print("  ->  5 min", 3, 0);
  display.print("     10 min", 4, 0);
  display.print("     15 min", 5, 0);


}

void loop() {

  analogWrite(uvlight, 0);
  analogWrite(motor, 0);
  digitalWrite(led, 1);

  menuActive = true;
  while(menuActive){
    delay(10);
    val = analogRead(button);

    switch(active_menuitem){
      case 1:
        display.print("  ->  5 min", 3, 0);
        display.print("     10 min", 4, 0);
        display.print("     15 min", 5, 0);
        if(val > button_up-10 && val < button_up+10){
          active_menuitem = 2;
        }
        if(val > button_down-10 && val < button_down+10){
          active_menuitem = 1;
        }
        if(val > button_press){
          menuActive = false;
          time_counter = time_setting1;
        }
        break;
        
      case 2:
        display.print("      5 min", 3, 0);
        display.print("  -> 10 min", 4, 0);
        display.print("     15 min", 5, 0);
        if(val > button_up-10 && val < button_up+10){
          active_menuitem = 3;
        }
        if(val > button_down-10 && val < button_down+10){
          active_menuitem = 1;
        }
        if(val > button_press){
          menuActive = false;
          time_counter = time_setting2;
        }
        break;

      case 3:
        display.print("      5 min", 3, 0);
        display.print("     10 min", 4, 0);
        display.print("  -> 15 min", 5, 0);
        if(val > button_up-10 && val < button_up+10){
          active_menuitem = 3;
        }
        if(val > button_down-10 && val < button_down+10){
          active_menuitem = 2;
        }
        if(val > button_press){
          menuActive = false;
          time_counter = time_setting3;
        }
        break;
    }

    //Debounce
    while(val > 50){
      val = analogRead(button);
    }

  }



  //Start sequence
  
  //clean menu
  display.print("    Time:   ", 3, 0);
  display.print(" UVlight:   ", 4, 0);
  display.print("   Motor:   ", 5, 0);


  digitalWrite(led, 0);


  for(int i = 0; i < motor_pwm+1; i++){
    analogWrite(motor, i);
    itoa(i, text, 10);
    display.print(text, 5, 10);
    delay(5);    
  }

  for(int i = 0; i < uvlight_pwm-10; i=i+10){
    analogWrite(uvlight, i);
    itoa(i, text, 10);
    display.print(text, 4, 10);
    delay(5);
  }


  //Main loop

 
  sequence_active = true;
  while(sequence_active){

    time_display_minutes = time_counter/60;
    itoa(time_display_minutes, text, 10);
    if(time_display_minutes > 9){
      display.print(text, 3, 9);      
    } else {
      display.print(text, 3, 10);
    }
    display.print(":", 3, 11);
    
    itoa(time_display_seconds, text, 10);
    display.print(text, 3, 12);

    itoa(uvlight_pwm, text, 10);
    display.print(text, 4, 10);

    itoa(motor_pwm, text, 10);
    display.print(text, 5, 10);


    val = analogRead(button);
    if(val > 1000){
      while(val > 1000){
        val = analogRead(button);
      }
      time_counter = 1;
    }
    
    delay(1000);

    
    //Clean values
    display.print("    Time:     ", 3, 0);
    display.print(" UVlight:     ", 4, 0);
    display.print("   Motor:     ", 5, 0);


    time_counter--;
    if(time_display_seconds == 0){
      time_display_seconds = 60;
    }
    time_display_seconds--;

    if(time_counter < 1){
      sequence_active = false;
      analogWrite(uvlight, 0);
      digitalWrite(led, 1);
    }
}
}

You would have to tell us, at least, which pins your devices are attached to. Is this the original sketch, or have you been fooling around with it?

hello m8

this is original... i haven't change it and i dont have any ESP8266 to try it
When i send it to my UNO, it gives me allot of errors regarding the OLED ( i was able to bypass that part )and it gives me an error of WIRE.h and it says it was design (the code) for a ESP.

to be honest i am lost. :frowning:

one on the uno i will try to use a rotary encoder ( the original uses a joystick ) and an H-Driver to run a stepper (as far as i know the original uses a normal DC motor).

thank you