Electronics > Beginners
Beginner Components?
BlueBill:
--- Quote from: JacobEdward on February 25, 2015, 04:41:23 pm ---
--- Quote from: WattsUp on February 25, 2015, 04:24:04 pm ---I'm not going to tell you to switch, as you seem content to use JS, but just consider why everyone else uses C
--- End quote ---
Everybody uses C because everybody else uses C... kinda straight forward but it's not a compelling reason for me to learn C
--- End quote ---
Actually it's an industry standard for programming, especially microcontrollers, and you'll find plenty of examples, libraries, projects, forums...
Anyway, do whatever you want. About a year ago there was a fellow on another forum trying to use an ARM7 for an emergency light when pretty much the cheapest 6pin MPU would have been overkill. Go figure.
WattsUp:
Look, I'm sorry, but that is one of the biggest selling points of C. If your C code isn't working, a properly worded question on any electronics forum (including this one) then you will likely receive a coherent response. How many people actually use JS on a MCU? 7? JS was designed for a different application, and while it is indeed possible to use it, it is not a practical choice for a beginner, hobbyist or professional. In my above answer I pointed out three points: portability, efficiency and community support. These three alone (and they are not the only ones) should at least give you something to think about. You can't just say:
--- Quote from: JacobEdward on February 25, 2015, 04:41:23 pm ---Everybody uses C because everybody else uses C... kinda straight forward but it's not a compelling reason for me to learn C
--- End quote ---
when I among others have given you plenty of reasons. And anyway, what's so bad about being the same as everyone else when it means you have support for any project, and you do not rely on someone else doing the hard work for you (OK someone has written the compiler but you get the message).
I'm not going to say any more about this now as it's getting ridiculous, but if you have any questions about the original topic then I will gladly help as I have throughout this thread.
Ben
Zero999:
--- Quote from: JacobEdward on February 24, 2015, 10:03:30 pm ---
--- Quote from: Hero999 on February 24, 2015, 09:39:07 pm ---JavaScript is a perfectly reasonable way to get into MCUs. Many other people here have started programming MCUs in other languages than C or assembly. BASIC is another common language which is supported by MCUs (remember using that Simon?). At some point you'll probably discover something you can't do in JavaScript and will need to learn C though.
--- End quote ---
Javascript is a turing complete language, there's nothing any other language can do that Javascript cannot do so if C can do it, then Javascript can... that said, what is something you expect I'll find that Javascript can't do?
--- End quote ---
Being Turing complete means fuck all, if it won't allow you to take full advantage of the hardware.
Try writing a driver for a piece of hardware for your PC with JavaScript. It won't work. You'll find the hardware abstraction layer gets in the way. The only way is to switch to a compiled language which will allow you to do what you want.
You don't *have* to use C if all you want to do is tinker but if you want to do this professionally you'll *need* to learn C.
--- Quote ---
--- Quote from: Hero999 on February 24, 2015, 09:39:07 pm ---Hz is a unit of frequency, which is the repetition rate. The period is the length of time it takes for a waveform to repeat itself and is equal to 1/frequency.
Duty cycle is how long the square wave is high vs how long it's low. A square wave with a frequency of 1Hz and a duty cycle of 50% will be high for half second and low for half a second. A square wave with a frequency of 1Hz and a duty cycle of 25% will be high for 0.25s and low for 0.75s. In both cases the period will be 1 second.
--- End quote ---
I'm aware of all of what you just wrote, my question was how does that differ from PWM?
--- End quote ---
It doesn't. PWM means controlling the duty cycle of a squarewave between 0% and 100% to represent an analogue value. If you put any waveform through a low pass filter, you'll get the average value. PWM is useful because by varying the duty cycle you can produce an analogue signal from 0 to the supply voltage of the microcontroller.
WattsUp:
Keep in mind the 600mW limit for power dissipation in the 555
JacobEdward:
Btw, incase anybody in the future might find this post of any use... if you're a beginner like me and are looking for cheap parts to experiment with or discover, this site has been pretty useful
http://www.taydaelectronics.com/
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version