6: Embedded Programming


Program your board to do something

Two weeks ago I was able to get the programmer to upload a 'blink' program onto my board using Arduino IDE, but not through bash shell on the school computer. What I also realized is that I connected the button directly to the VCC rather than a pin #6 so I could only test programming with the LED for this week. I wanted to set up the programming environment at home because I didn't want to rely exclusively on the school computer to program my boards for the future. The First setup was Windows + Arduino IDE: the key part of this setup was to install the driver for Windows - the rest of the setup was straightforward, and I was able to replicate the procedure for programming the 'blink' sketch on my board.

Then I wanted to set up the bash shell so I could program directly without relying on Arduino. I couldn't get the Windows Linux subsystem to work properly so I installed the VMware instead. Unlike the last time I tried on the archshops VMware, the hello echo program installed correctly, but the term.py kept freezing upon loading. I found out that the problem was that I did not have pyserial installed - after installing the module I was able to get the hello echo program working.

On to setting up the blink program. I took Neil's Arduino file and modified the necessary parameters (setting PORTA as led_port and DDRA as led_direction, and 7 as led_pin).

The last thing- I was intrigued by Dylan's comment during the class on how "dimming" works with the binary light - by using the technique called pulse-width modulation. I do not know the workings of the code well enough but I thought it would be cool to at least try programming (basically trying out his code- thanks Dylan!) it on my board. Here it's working - though I am not sure why it is so much dimmer than Dylan's example.