Week 11 Input

by Moritz Begle


Posted on April 10, 2013 at 15:00 PM


Input devices

The aim of this class assignment was to create a microcontroller with an input device. There are diffrent possinilites for input devices which are listed up "here"

I am including this assignment for my final project where i created a own build microswitch using a infrared led and a phototransistor. As soon as something goes inbetween the two it will stopp the steppermotors as it has reached the end of the rail.

Software:Eagle

Microcontroller: Attiny 45

"EAGLE PNG Inside" "EAGLE PNG Outside"

Before you can start programming & connecting the microcontroller to the FABISP, make sure that you go through all the steps already explained int the assingment of week 9

Programming

- In order to make the serial communication on the attiny 45 work you have to include the "serialsoftware.h" which is mostly already embedded in the arduino software, which means there is no need to download & install it.

Serial communication = very old & basic linear communication similar to the morse code using rx and tx to send and receive the datas.

ftdi cable is converting the information from usb to a serial communication.

With this code example I was checking if the serial communication is working using a simple led and a switch.

With this code example I was checking if the serial communication is working using a simple led and a switch.

This Code is the actual code for the PT and IR led which will be tested as soon as i am getting the IR led.

Joystick - Input Device

The second inputdevice I connected to my fableo was a Joystick module. The Fableo has been adapted in terms of arranging the output pins. The files and drawings of the FaB Leo can be found in my other blogpost under this "link"

With this "Code"

I am reading through serial the movement of the joystick and map it to the brightness of the LED. This will further help me to control manually my steppernodes.

Blog Search

Keywords

Fableo, joystick, arduino, serial, input, sensor, leonardo