I upgraded the random flashing lights code, it is now random using the Arduino’s random() function, which is apparently sudo random, as if you run it many times with the same seed, then you’ll get the same long old list of numbers, although they do appear to the human eye to be random if you didn’t know that. I have seeded the random by reading a floating analogue pin, so it’ll get a value between 0 and 1023 and use that for the seed each time the Arduino starts. Which will be plenty random enough for me. I am not happy with this code yet. The lights need remain on for greater periods and also overlap during their on periods. Not really sure how I’ll achieve this yet, but I’m sure it’ll fairly easy. Also, I need to resolve the indicators not coming on. Something is either wired differently in […]
I have created a new revision of the code that runs on the Land Rover Arduino. This extra bit of code will run a bit of program that just loops, flashing the front head lights. Here it is in the simulator in action.
I had this incredibly minor issue where when the Arduino is initially turned on it goes through the setup bit of the code setting pins to be what ever you want them to be and making them inputs or outputs. As it was doing this and where I had relays attached to these outputs, the relays would momentarily come go into the on position before being turned off in the body of the code as the input is pulled down and then the switch position read. This only really became an issue when I get the horn working on the Arduino. Each time the ignition was turned on the horn would just do the tiniest beep. I did some reading on forums and found a easy coding fix for this. This fix was to add the digitalWrite in before the pin is set to be an output. Simple eh? it’s […]
Archives