Ok, so I do not have the correct joystick component yet but looking Ok so far otherwise.
Even the vibration motor pads which were a bit of a guess due to bad documentation (and which i drew myself) were 100% correct
Ok, so I do not have the correct joystick component yet but looking Ok so far otherwise.
Even the vibration motor pads which were a bit of a guess due to bad documentation (and which i drew myself) were 100% correct
Everything works!
Dead simple to use:
#include "Pokitto.h"
Pokitto::Core mygame;
Pokitto::Display d;
mbed::DigitalOut jh_rumble(EXT0);
mbed::DigitalIn jh_b1(EXT15);
mbed::DigitalIn jh_b2(EXT14);
mbed::AnalogIn jh_x(EXT1);
mbed::AnalogIn jh_y(EXT2);
int main ()
{
mygame.begin();
while (mygame.isRunning())
{
if (mygame.update())
{
jh_rumble.write(mygame.buttons.aBtn());
d.color = 1;
d.printf("Joy X: %d\n",(int)(jh_x.read()*100));
d.color++;
d.printf("Joy Y: %d\n",(int)(jh_y.read()*100));
d.color++;
d.printf("B1: %d\n",jh_b1.read());
d.color++;
d.printf("B2: %d\n",jh_b2.read());
d.color++;
d.printf("A to Rumble!\n");
}
}
}
The only complaint I have is that the motor sucks the battery empty quite fast, if you spin it all the time!
Apropos, does anyone know of a open-source 1942- type game? (vertical scroller)
Any ways to make very light vibrations so it doesnât suck that much power?
I was just going to post the same link
Does sensitive rumble? Or will it need changed?
What pin did you use to drive the motor?
It turned out that its something else.
I think I will need to add a capacitor in the design to âkickâ the motor or control it in a bit different way.
I canât remember for sure, but the sensitive page say to use pins 1 and 3, so I assume pin 1 might be the positive and 3 Be pulled to gnd (just a guess right now though).
@Vampirics beat me to it.
I keep trying to tempt @filmote over here more.
If you havenât looked at @filmoteâs GitHub yet, you should.
Heâs made a whole hoard of Arduboy games.
Completely unrelated:
I find your keyboard layout incredibly interesting.
Also, Thinkpad +1
I love the keyboard. What can I say.
Edit: beats the crap out of my new expensive workstation laptop (HP)
What are the resting and tilted values for the joystick?
I.e.
is xAxis.read()
around 0.5f
in its resting position?
is xAxis.read_u16()
around 512
in its resting position?
is xAxis.read()
around 1.0f
in its far right position and 0.0f
in its far left position?
is yAxis.read()
around 1.0f
in its far up position and 0.0f
in its far down position?
(I want to try to get my noughts and crosses game working with the hat so you can test it.)
At the moment Iâve got most of the framework in place,
but it wonât work properly unless I know the axis values:
JoyhatNoughts&Crosses.bin (44.1 KB)
Looks like extreme fun ! Head-to-head (helmets might be needed)
When can I order the hat?
Edit: Maybe someone in the community can design the 3D printable cover for it (if @jonne do not has time to do it ), when we get our hands on the PCB?
Edit2: We have a very good opportunity here at the local library. Anyone can reserve a 3D printer for four hours for 1 euro, including the materials (!).
I am incredibly envious.
I had a litl go at building one, I think I have my joystick positioned wrong. With my pokitto the correct way up, pushing the joystick up, brings the Y value up and down brings it down, the Xis as I expected with left being lower than right.
Also, do the buttons get grounded, or are they raise when pressed?
[edit]
Got the joystick working in the same direction as my screen and both buttons working as well as the motor. @Pharap one of us has the joystick Y upside down, I donât know which one of us though! Also, I think more of a dead zone is needed, when I press up/down, it has a habit of moving left/right also.
I havenât added the i2c header to mine, I couldnât find in the thread which way round the d and c pins are.
The answer is: neither of us.
Take the same joystick, rotate it 4 times and you go through every possible combination of axis poles.
Sadly, this kind of thing isnât standardised.
Thatâs why I want to know what the actual hat is going to do,
because thatâs the standard any programs using the hat will have to go by.
Thatâs why I was asking for figures from the actual hat, so I could make adjustments.
If it even works, thatâs just a testement to my ability to âfly blindâ, because I donât even have a mockup to work with. :P
if you can post the figures I asked for for your homemade version then I can post a bin that should work for your homemade version.
I need to know the values for read()
and/or read_u16()
(preferably both) for both axes at the resting position and the positions at which you think each direction should be registering.
(Iâll shove the source on a branch as well so you can tweak it if you want, though I was hoping to get confirmation that it worked on the genuine article before putting the source up.)