06 February 2026

Mapping - Ignacio Vergara

 

Mapping

Concept Description

For this mapping assignment, I created a project called The Alchemist’s Oracle. The project is designed as an alchemist’s workbench used to explore possible outcomes of a transmutation process before actually performing it. The goal is to allow the Alchemist aka the user to experiment with different combinations of inputs and receive immediate visual feedback, reducing both magic material cost and risk of self evaporation. The final output is represented by a crystal that lights up in different colors, symbolizing the predicted result of the transmutation.

The system uses three different inputs, each representing a specific component in the process. The first input controls the amount of suspension being added, the second controls the stabilizer, and the third represents how much “soul” from the alchemist is embedded into the transmutation. By adjusting these inputs, the user can test different combinations and observe how the expected outcome changes through color variation in the RGB LED.

Technical Description

Technically, each input is connected to a separate analog pin on the Arduino. The values read from these inputs are mapped directly to the RGB LED channels. The potentiometer controls the green channel, the photoresistor controls the blue channel, and the joystick controls the red channel. As the analog values change, the brightness of each color changes accordingly. When only one input is active, the LED displays one of the primary colors. When multiple inputs are active, the colors blend together, creating secondary colors. This project demonstrates how analog sensor data can be mapped to meaningful visual output using an Arduino.

 Video Demonstration

 




 Photos





 Sketch

  

 

Schematic




Code

const int ledPinR = 9;
const int ledPinB = 11;
const int ledPinG = 10;

const int knobPin = A0;
const int photoPin = A1;
const int joyXPin = A5;
const int joyYPin = A4;

const int Min = 78;
const int Max = 735;

void setup()
{
  pinMode(knobPin, INPUT);
  pinMode(photoPin, INPUT);
  pinMode(joyXPin, INPUT);
  pinMode(joyYPin, INPUT);
 
  pinMode(ledPinR, OUTPUT);
  pinMode(ledPinB, OUTPUT);
  pinMode(ledPinG, OUTPUT);
 
   Serial.begin(9600);
}

void loop()
{
  //Photoresistor

  int photoValue = analogRead(photoPin);
  int mapPhotoVal = map(photoValue,Min, Max, 0, 255);
  mapPhotoVal = constrain(mapPhotoVal, 0, 255);
  analogWrite(ledPinG,mapPhotoVal);
  //Serial.print("The photo value is: ");
  //Serial.println(photoValue);*/
  delay(100);
 
  //Knob

  int knobValue = analogRead(knobPin);
  int mapknobVal = map(knobValue,0, 1023, 0, 255);
  analogWrite(ledPinR,mapknobVal);
  //Serial.print("The knob value is: ");
  //Serial.println(mapknobVal);

  //Joystick
  int joyXValue = analogRead(joyXPin);
  int mapJoyXVal = map(joyXValue,0, 1023, 0, 255);
  analogWrite(ledPinB,mapJoyXVal);

  Serial.print("The joy X value is: ");
  Serial.println(joyXValue);
}

 




No comments:

Post a Comment

Note: Only a member of this blog may post a comment.