|
Journal
entry: Week 3
Project
2
MyExperience Thursday Oct 4th
I jumped on a computer just as someone was leaving, lots of people working.
I pugged in my wires and the chip read last weeks project. Good start.
So, I thouight Id take apart my board and rewire it for the new
projects.
So I wrote up the simple code, with a debug.print to start. It didnt
even read that.
For the life of me I could not understand the problem. I checked the cable,
I checked the ports.
I re-saved my work and re-opened it up. The Bx software was still reading
from the folder of the previous person. In fact throughout the whole time
I worked after restarting a number of times, it continued to go directly
to the old folder. I though at one point I cancled out the file path but
maybe I did not do it right.
I went through the 3 or 4 different examples. On step 3, count how many
times a LED turned on in a group of them, the only time the lights turned
on 1 after another was if I wrote 2 debug.prints one for the count and
the other for a specific pin #
Code:
Dim nextLightVar as byte
Dim switchVar as byte
Dim switchedOnVar as byte
Sub Main()
Do
For nextLightVar = 13 to 20
Call putPin(nextLightVar, 1)
Call putPin((nextLightVar 1, 0)
Delay (1.0)
Next
SwitchVar = getPin (5)
Call puyPin(20, switchVar)
If getPin(5) = 1 then
SwitchedOnVar = switchOnVar + 1
Emd if
Debug.print cstr(switchedOnVar)
----debug.print (getPin(19))----
Loop
End sub
If the 2nd debug was commented out then pin #19 would alsways stay on
and not take part in the nextLightvar string.Also, 1 light was always
dimmer than the rest
I could not understand why. Then I switched
resistors and found out that it was not the same as the rest causing that
particular light to be dim. So it matters what type of resistor you have
infront of a light.
|