Saturday, September 30, 2017

19 September '17- Day 7- Random numbers and Recursion

Todays class involved a speaker and creating sound from the speakers.  Fairly simple lab but has tons of potential with the overall use of it.  The more tedious portion of this lab was to write certain songs in the library for pitches to be able to play the songs we'd like.

(wiring the speaker into the breadboard)
During lecture we began discussing generating random numbers and also recursion.  To generate a random number there is a function included in the standard C library called "srand(seed)".  This will generate random number.
Recursion is the ability for a function to call on itself.  A good example for this type of function would be factorials since computing a factorial would require that the first term is defined in order to solve for the next one.


(the different sensors learned up until today)




No comments:

Post a Comment