Electronics Vending Machine

From Makers Local 256
Jump to: navigation, search

Creator:
Traza
Status:
In-progress
Born On:
18:34, 25 April 2016 (CDT)
Last Updated:
19:06, 25 April 2016 (CDT)

Overview

This is a work in progress that will supply the wonderful makers with a source of electronics and tidbits to help with their projects.

Hardware

  • 25 slot "cigarette" vending machine
  • Raspberry Pi
  • Touchscreen Interface
  • PC power supply

Software

Xinput

In the raspberry pi config.txt file, you can set lcd_rotate and display_rotate.

lcd_rotate can only flip the screen. But will also flip the touchscreen input.

display_rotate can rotate at 90 degree intervals, but doesn't not affect the touchscreen.

So... We want to rotate the pi's screen 270 degrees. Thus, display_rotate has to be used. But now how to we get the touchscreen input to match?

xinput list-prop 6

List the available properties of the pointer with the above command. Replace '6' with the appropriate device.

To adjust the input (rotated and then inverted) apply the following transformation matrix:

xinput set-prop 6 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1

Links:

https://wiki.ubuntu.com/X/InputCoordinateTransformation

https://www.raspberrypi.org/forums/viewtopic.php?f=108&t=122032