Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
I'm using scons (is that a compiler, idk I'm a noooob).
I got rid of the for() loop in random() because I only want to generate one number, and set the range to 6 (I think) so it looks like this now:
int random()
{
int num;
num = rand() % 6;
return num;
}
The code runs...
I want to put a delay in my code to wait for a random number of seconds before going forward. I'm new to C and coding in general so I tried to patch together two example functions I found (random and delay), but so far it's not working. This is what I have so far:
// generate a random number...
Thank you all for the help. It turns out this issue was that my code was not in an infinite loop in my main function, so each time it looped back to the main it reinitialized the pin as an input and then an output again, so I was essentially picking up an average of the two voltage values.
I'm extremely new to this so please bear with me. I'm trying to turn on an LED (4v max.) using one of the digital i/o pins, but the pin is only outputting about 1.5v. The pin is set as an output. I also have a 12v power supply connected to the board to power several 12v push buttons. I have no...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.