The assignments for week 11 was to add a sensor to a microcontroller board and read it
My plan was to make the hello.load step response board
The reason i choose that board is because i thought that i could implement some features from the board to my final project
My final project idea at the moment is a race game for two players
The idea is to have two motors connected to two seperate remotes with two buttons on each remote
My plan is to have a 3d printed character on each motor that would move forward when the two buttons on the remote are pressed(the motors spin when the buttons are pressed)
The character who first reaches the finish line wins. I could have a copper on the endline and when the character touches the copper a light turns on that indicates that this character is the winner
I wanted to make a step response board and i chose the hello.load.44 board
The cutting of the board and the soldering went very well and i am getting much better at soldering now
Instructions on cutting out boards using the modela can be found in week 4
I also cut out a plexi glass plate to put the board on
HereĀ“s the outcome
To see if the board would work correctly i connected it to an AVRISP
The AVR gives you a green light if the board is working properly and luckily that was the case with my board!
For the programming of the board i decided to use linux enviroment
I saved the c file, the makefile and the python file into a folder on the desktop
You can find these files on the archive
Next i opened the terminal and found my folder there
My board and the AVRISP were now both connected to USB ports in the computer
Now i had to send the program to the board and run the makefile
To do so i wrote: sudo make -f hello.load.45.make program-avrisp2
If you're using an FabISP instead of AVR microcontroller write: sudo make -f hello.load.45.make program-usbtiny
This message came up when i was finished. The board was programmed!
Now i could unplug the AVRISP but i kept the board plugged in
My next step was to run the python file
I figured out that the serial port i was using is called ttyUSB0
Now i opened the folder with the python file by writing: python hello.load.45.py and wrote in a command line:hello.load.py serial_port
Now the serial port was open and my final command was to write: python hello.load.45.py /dev/ttyUSB0 and python opened!
Now was time to test the board. I soldered copper pieces to all the pins and tested the board
I also included input device work in my final project
I controlled a stepper motor by pressing a button
You can read about it here in the Electronics section