Here is a picture of the old diagram that I made, before today.
I added a second button for the horn today. Here it is, on the right of the Headlights button.
This is the new Rear Lights Board. It could use some work, but it is complete now.
This system shows the wiring for the Rear Blinkers that I made. I connected the Anodes of the LEDs to the Pin Inputs of the Front Blinker LEDs. Therefore, the Rear Blinkers are controlled with the same input signal as the Front Blinkers. My only concern is the Cathode going to ground constantly, with an inconstant Anode input. I wonder what I could do to fix that.
Here, you can see the front Blinkers and Headlights system on the Function Board.
Also, the group was thinking about discarding the hollow steel legs, but I said that they could make those crazy tailpipes on those decked-out cars.
But back in Arduino, I would really like to use some Analog Inputs. If I were to use the LCD Screen, I could make a funny little pseudo-radio. If I write a looped tune for a specific variable, then print a funny channel name onto the LCD Screen, I could actually do it. Actually, that sounds like a great idea! So, I have to mock it up now.
So, I made it. You can see the Light Board, the Keypad Board, and the Bridge Board. Anyways, let's get into the fine details here.
I want to int a variable that changes when you press the red buttons on the keypad. Then, the board detects that value and sends the tune to the Piezo Buzzer, which is controlled by a transistor (I didn't make it on Fritzing yet). Another button on the Keypad will serve as a toggle on/off switch for the Piezo Buzzer Transistor. This functions as a rough volume/ on or off switch for the radio. Preferably, I could shut the LCD Screen off too. But, each channel will have it's own fake frequency and tune-loop.
Today, I completed the Arduino build based on my Fritzing Diagram. Here it is.
Everything is completely set up so far for my design. Now, I will code for it, and continue to maximize my abilities with this limited setup. Essentially, if I get all of the basics down and I want to add more, I can (and probably will).
That's pretty much all I did today, optimizing and constructing the whole thing. However, the rest of the group did good stuff too!
Today, we plan to actually use the Shopbot on the wood, and map out where possible screw locations include for the board. As well, we can now see how to use this Table Saw.
I will continue this fun and educational adventure in Arduino, only this time, I'm coding. Here we gooooo!
But wait! I have to talk about what exactly my code's going to do.
So first, I will code it to digitalRead() the keypad inputs. Basically, I will wrap all of the primary functions of the board into an If() statement depending on the keypad inputs. Those are the fundamentals of my code. This will include:
- Row 1 - Lights
- Button 1: Left Blinker Function
- Button 2: Headlights On
- Button 3: Right Blinker Function
- Row 2 - Radio Control
- Button 4: Decrease Radio Variable by 1 (Back 1 Station)
- Button 5: Radio On/Off
- Button 6: Increase Radio Variable by 1 (Forward 1 Station)
- Row 3 - Piezo Horn
- Button 7: Horn Tone 1 (Traditional Car Horn, may want to make it a while() statement for that real horn feel)
- Button 8: Horn Tone 2 (
- Button 9: Horn Tone 3 (Dixie Horn)
- Row 4 - Unassigned
- Button Asterisk:
- Button 0:
- Button #:
Secondly, I will program the pseudo-radio stations via a variable I int in, and more fun If() statements.
On the side, though, I had this idea about a creative input panel for Arduino functions on a project such as this! It kinda was born of my frustrations of not using lots of analog inputs in any of our projects aside from Potentiometers for Human Input. If I had either some If() or While() statements to read some light sensors, and I put the light sensors on a breadboard being covered by a box with holes. When one of the holes is covered, the light sensor reads a negative value given the threshold for the light sensor reading either a true or false value.
Basically, this prototypical input box would be good for another project involving User Input similarly to the car.
Mr. Estock, however, suggested that I make an Arduino Throttle. That would be fun, provided that I can control the throttle quickly and easily. It would be good because:
- It would give me a hand in the actual machinations of the car and not the features of it (Like quality leather seating and a treated wood dashboard.)
- I could utilize Arduino in a major role in the project.
- It's like, super simple to code for a Motor.
It wouldn't be good because:
- I worry about the amount of time that the servo would take to complete a full rotation to get the throttle on and off.
- I worry about the amount of force that the servo and axle wing thingie could withstand.
- That's really it but I added a third entry to make these lists look symmetrical.
I guess, though, that Problem 2 is the only real concern that I could possibly encounter. I feel somewhat confident in the speed of the motor. I think I could make this work!
Anyway, I'm going to get to coding. I've been #troubleshooting™(© 2017) all class.
First, today, I'm going to try and whittle down the requirements for the things that the rest of our team has been doing lately. Unfortunately, not everything can be about Arduino.
Alright, I've done it. Next time, I need to try and write my code for them both. Then, I can test for the input from the keypad.
So today I had the idea to save myself the hassle of writing the tedious tone() and delay() style music with no tempo and sucky articulation. So, I decided to make my own musical functions and variables, with the pitches.h library for the Piezo. Here's some of my stuff from tonight.
Today, I'm going to try and write the code and finish wiring the wire booleans for the little Trinket and the Mega to work together.
OH MY GOSH so I plugged the Trinket in for the first time and it started doing this adorable little LED fade thing! I think it's really funny just because it's so teeny!
So, here's what I'm doing.
Today, I'm going to actually do what I've been saying that I was going to do and actually write my code for the Mega, and better yet, the Trinket. I'm also going to FLIP if someone or something replaces my Swedish keyboard! Agh!
Anyway, I'm going to design my function now, and below, I'm going to divide what I want and have for each system for my reference. And I won't spend 8 hours on it.
- LCD (The Entire thing is controlled via the Mega).
- Piezo Buzzer (Whole Thing).
- Pins to Headlights (Need boolean for tandem operation).
- Power Source: Computer or Battery Pack.
- GND + Pins to Blinker LEDs.
- GND to Headlights
- Power Source: 5V from Mega.
- Live Boolean Wires to digitalRead() from Mega for the Headlights Tandem Operation.
The first change I've made is to rename pins 22 and 23 on the Mega rblinkersig and rblinkersig, for simplicity and ease of memory.
Alrighty, Problem #2. I need a live connection of booleans or some way to signal for the Headlights to be on. I can't read the things positive volts from the Mega PWM ports, and I have no more ports to work with with the Trinket.
OH WAIT OOPS so I was all freaking out about the GND problem, and how I'm going to control it, but it's GND'd anyway by the Trinket GND! And I control the positive voltage from the Mega! Whoops!
Alright, so I think that everything should work better now, I've edited my Fritzing so I have the boolean things.
I spent a small portion of this class period fixing some of Kelsey's code. It was pretty fun! They were just teeny fixes that were not
Next class, I have to finish polishing my code as always, and actually wire this junk. Also, I shouldn't forget about the melodies, but that should be easy with my music language code! Muhahaha!
Also Port #2 on the Trinket is still open, I want to know how I could use that. But anyway, everything is coming together so far!
Ok, so I feel a teensy bit worried about my progress today. I don't know why, but I do. So, here's to working extra hard!
First order of business is to code for the Trinket. I have to do this quickly.
OK, so I feel a lot better about something! I keep forgetting, for some reason, that I do not need to control the headlights from the Trinket. I was super stressed about finding some way to steal an input or do some complicated double signal boolean logic thing for the 2 live boolean connections, because I totally forgot that they are already GND'd, and have a + Input from the Mega. Whoops! So, basically, the light systems are a complete circuit, and their code is finished.
The next thing I'm worrying about is the actual functioning of the keypad. I can't remember if I got it to work in my code or not, I only really remember studying and trying to understand how to get it to return the desired values. Because clearly scrolling up is too much for me, I'm going to try my test code again and see how it works.
WAIT but I'll do that after I wire my live boolean junks.
Well, a previous entry said I did get the keypad to send information via the HelloKeypad.ino code, but I cannot tell if I had applied it to real functions or not. Either way, I'll test it after I wire my thing.
Well, I broke my own rules deliberately put in place for me to follow. What a #Rebel I am. In any case, I modified a version of the example code for the Keypad with some custom Serial.print() stuffs. It works, and here's a video for proof:
What the Others Have Been Doing:
The other members of the team have been working diligently on the body of the car. Here's what we have so far:
(Sorry, I didn't know what to put to complete this matrix of cool videos and I'm still hungry.) Jag är fortfarande hongrig, men jag ätade min frukost. Värför är jag den vä?
BACK TO WHAT I WAS DOING,
I've gotten the Keypad to work again, and I added in break; structures in the case() forest I've got going on, and I think that should help it actually function? I remember a time I tried and I clearly had no idea I needed that (like yesterday), and it was just not doing things that were correct. In any case, however, I'm going to get the wire box out for my live-wire booleans.
Next time, I have to put the code in the Trinket, and test the Tangerine VII code I have created in the Mega.
Yeah, first day back from break and I am pumped! Let's do this! So, my code is looking pretty good right now. Let's take a look from whatever I said to do last time, and get on that.
Alright, looks like I'm coding for the Trinket. Here we gooooooo!
So before, I was a punk and forgot to add the actual functions() of the MEGA and Trinket Tandem code. So here's my logic behind this.
First, the Mega will DigitalWrite() a HIGH signal to the l or rblinkersig port for the live+wire booleans.
OH WAIT OOPS I FORGOT THAT THE TRINKET CONTROLS EVERYTHING WITH THE LIGHTS. I believe that I ran into some trouble with something about it, though. Hmm. Let's take a look on the good ol' Fritzing, shall we?
Ok, so what I have is that the Trinket sends a continuous GND signal because it is consistently powered by 5V from the MEGA. It's direct, too, so I don't have to write any code to power it or anything. Alright, so the only thing I have to code for is while the Trinket receives the l or rblinkersig() signal from the MEGA, to DigitalWrite() the Yellow LED's on.