Hall Sensor as an axis (joystick

Hello everybody,

I'm relatively new to programming in general. I have an Arduino Micro and want to make a usb joystick controller where one of the axis is used by an hall effect sensor.

I have an TLE 4905L hall effect sensor (Datasheet: https://www.distrelec.nl/Web/Downloads/90/5l/ortle4905l.pdf)

I used a code from somebody else. This code was intended to use with a 10k potmeter (slider):

#include <Joystick.h>

void setup()

{pinMode(A0, INPUT);
Joystick.begin();}

const int pinToButtonMap = A0;

void loop()

{int pot = analogRead(A0);
int mapped = map(pot,0,1023,0,255);
{Joystick.setThrottle(mapped);}}

I want to convert this code to use with my hall effect sensor. Can someone help me in what I need to change in the code for it to work with the hall sensor. Many thanks.

Under features, note that it says "Digital output signal" and in the schematic there is a Schmitt-Trigger. That means that the sensor will output only LOW or HIGH, no analog signal. You simply can not get an analog signal from the sensor no matter the code.

Ah I understand now. So using a different kind of hall effect sensor would work right? For example:

Honeywell SS495A:
http://docs-europe.electrocomponents.com/webdocs/009a/0900766b8009a37c.pdf

That does seem suitable, although I have no experience with that part.