Hat of many things


#1

so there has been some mentions of hats all over the forum
so it might be a good time to start working on one

knowing support for these in games and other software might get tricky if there to many hats only doing one thing it might be a pain

so we can plan to make one hat to do a bunch of stuff, to keep it realistic i would like to restrict it to 5 or so features.

  • i liked the idea of the rumble motor

  • kinda wanna add a IR transceiver as the most basic of link but also to be able to control lego power function stuff

  • wireless seems to be still a problem with power consumption and kinda dont want to add an extra battery

  • gyro/accelerometer/magnetometer chip might be nice but idk if many people have a use for it

theres definitely some stuff to add here or maybe chance, feel free to brainstorm about it, this is a community effort :wink:


#2

I can imagine a tumble hat shaking itself off if used a lot :smile:.
A multi-hat sounds good to me though. Hopefully something will come of this idea.


#3

there some ways to secure a hat to the pokitto case with some lego parts, but your right, it might also rattle the pcb and lcd


#4

No danger of that. 26 pin connector. Sticks like glue.


#5

I think GPS might be more useful than the 9DOF. If nothing else, you get the current time out of it.

And no mention of a camera? Would power be an issue for that? But you could then create PokittoMon Go.


#6

…my concern with the ‘hats’ is that it may only take a simple typo in the code to set an input or output the wrong way and potentially fry the hat or the Pokitto itself! it seems difficult to be able to design a hat to share with the community, because you can’t ever really safely assume the known state of the header pins on anybody else’s Pokitto?


#7

Well frying something would only happen if you plug it in the wrong way.
Most of the hats probably have some chip so they be spi/i2c or something (i2c is nice for backwards compatibility with gamebuino modules)


#8

Well, if the Pokitto’s buttons pull the pins directly to Vcc or GND, the same problem exists even without a “hat”, by programming the button pins as outputs.

In any case, the problem can be minimised by creating thoroughly tested libraries for each hat (as is the case with the pokitto’s buttons) and telling developers to always use these libraries instead of directly manipulating the hardware. This way only the people who develop the libraries are at risk to causing damage.


#9

i am almost 100% sure you can not damage pins like this. the pins are not just hardwired to silicon. there are protection diodes and the output goes through a mosfet. i don’t believe the design is so stupid that you can burn a pin by applying Vcc to output pin set at zero. i will check this.


#10

seriously? how would you even fry that with code? as long as the hat is running with 3.3v and no extra power sources there like not much that can happen


#11

The same way you could with an Arduino or most other microcontrollers or other digital outputs.
See Method #1: Shorting I/O Pins to Ground:
https://www.rugged-circuits.com/10-ways-to-destroy-an-arduino/


#12

pretty sure the buttons are pulled up/down by a resister[quote=“mwm, post:5, topic:262”]
I think GPS might be more useful than the 9DOF. If nothing else, you get the current time out of it.
[/quote]
gps is nice but since there will be a rtc on pokitto makes that current time a little less of a problem
in terms of games theres not much you can do with gps compared to gyro accelerometer

camera can be done but image manipulation might be tricky and i would expect not allot better then the gameboy camera, basically both ideas could work as there own hats, those parts are pretty expensive as well


#13

Normally they’re not. You use the pin’s internal pull up or pull down resistor and then the button shorts the pin to either Vcc or GND.


#14

According the to the datasheet, the high level short circuit output current is 45mA and the low level short circuit output current is 50mA.

Note 16 says this is Allowed as long as the current limit does not exceed the maximum current allowed by the device, so the LPC11U6x is a fairly robust device and shorting one pin probably won’t cause any damage.

It’s possible shorting multiple pins at the same time could cause damage. However, it’s not clear what the maximum current allowed by the device actually is. It likely depends on total power dissipation and the maximum temperature. So how many pins shorted would cause damage? It’s difficult to say.


#15

was going to quote the same datasheet.

i have shorted gpios by accident and the device did work. so i will do tests today

btw buttons are pull-down


#16

also i kinda think it be best to use a serial interface for the hat so games can detect it
see my gel concept
basically if there is a hat with a temperature sensor and another one with a similar sensor the game that uses it doesn’t need to be rewritten to check for both types of hats, going serial also still give you allot of extra pins to do other stuff with


#17

A gps module, a 9dof and a raspberry pi camera are all between $5 and $10 at the low end. Of course, those are the breakout modules I normally buy for such use. Possibly if you’re buying SMD components for PCB design it might be different.

A GPS clock and an RTC are just enough different to be interesting, and work well together. In particular, the demo library for a GPS clock should use one of the button presses to set the RTC to the time coming from the GPS clock. I expect that to be set from the USB port most of the time, but having a second accurate time makes for some interesting possibilities.

I have both in my parts bin, so maybe I’ll find time to experiment with them.


#18

Is there a list somewhere of which I/O pins are already used (if any) by current pokitto hardware, such ad buttons, speaker etc.? I think that would be a good starting point for a multi-use hat.


#19

I think I/O pins in the header not using for hardware. Datasheet says LPC11U6x can have up to 80 I/O pins.


#20

All you need to know to use the hat: