{"author_name":"Atomic","cat":"LD #25","comments":[],"epoch":1355572500,"likes":1,"metadata":{"p_key":"49387","p_author":"Atomic","p_authorkey":"1556","p_urlkey":"85063","p_title":"First interaction","p_cat":"LD #25","p_event":"LD25","p_time":"1355572500","p_likes":"1","p_comments":"0","p_status":"UPD5","us_key":"1556","us_name":"Atomic","us_username":"atomic","event_start":"1355443200","event_key":"14","event_name":"LD25"},"text":"<p>Coded the button interaction. Electronic buttons need a hack known as debounce because they bounce back and forth between 0 and 1 very quickly\u00a0 until they settle. The hack consists of reading the button twice with a short delay (say 10ms) to see if the state is the same.<\/p>\n <p>So here&#8217;s what the code does now: init the screen, button and speaker. When the button is pressed the speaker beeps a middle-A note and the screen inverts (black to white or white to black).<\/p>\n <p>Now to figure out the game loop!<\/p>","time":"December 15th, 2012 6:55 am","title":"First interaction"}