Skip to content

Instantly share code, notes, and snippets.

View Xhendos's full-sized avatar

Youri Klaassens Xhendos

View GitHub Profile
@Xhendos
Xhendos / TM4C1294NCPDT_Interrupt.c
Last active September 2, 2018 10:51
This is the hello world program for the interrupt availability in the TM4C1294NCPDT microcontroller
#define GPIO_PORT_CGC_R (*((volatile unsigned long *) 0x400FE608))
#define GPIO_PORTA_DIR_R (*((volatile unsigned long *) 0x40058400))
#define GPIO_PORTA_IS_R (*((volatile unsigned long *) 0x40058404)) /* Interrupt sense */
#define GPIO_PORTA_IBE_R (*((volatile unsigned long *) 0x40058408)) /* Interrupt both edges */
#define GPIO_PORTA_IEV_R (*((volatile unsigned long *) 0x4005840C)) /* Interrupt event */
#define GPIO_PORTA_IM_R (*((volatile unsigned long *) 0x40058410)) /* Interrupt mask */
#define GPIO_PORTA_RIS_R (*((volatile unsigned long *) 0x40058414)) /* Raw interrupt status */
#define GPIO_PORTA_MIS_R (*((volatile unsigned long *) 0x40058418)) /* Masked interrupt status */
#define GPIO_PORTA_IC_R (*((volatile unsigned long *) 0x4005841C)) /* Interrupt clear */
#include <stdio.h>
#include <stdbool.h>
/* Contains floor() which will round */
#include <math.h>
/* Prototyping */
bool calculate_instructions(int delay1, int delay2);
bool float_mod(double instructions);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Created by : Youri Klaassens ;
; Date : 07 October, 2017 ;
; Description : Set LED while button pressed ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#include <p16f1829.inc>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Created by : Youri Klaassens ;
; Date : 4 October, 2017 ;
; Description : Rotate all 4 LEDS ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#include <p16f1829.inc>
/*
*A header with all includes.
*/
#include "program.h"
int main()
{
struct sockaddr_in socketaddress_in;
struct icmphdr *icmp_header;
#include <stdlib.h>
#include <stdio.h>
#include <netdb.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
int main(int argc, char* argv[])
{
#include <stdlib.h>
#include <stdio.h>
/*
* Describes getnameinfo()
* Used to get the IPv4 or IPv6 address from an interface.
*/
#include <netdb.h>
@Xhendos
Xhendos / socket_output
Created July 2, 2017 11:57
Outputs socket
[SL] Integer of socket is 3
[SL] Succesfully assigned information. Attempting to connect to 84.106.40.114
[SL] Succesfully connected to 84.106.40.114 on port 80.
[SL] Succesfully send to 84.106.40.114
[SL] Succesfully received from 84.106.40.114
HTTP/1.1 200 OK
Date: Sun, 02 Jul 2017 11:56:21 GMT
Server: Apache/2.4.6 (CentOS) PHP/5.4.16
X-Powered-By: PHP/5.4.16
Content-Length: 7282
var buttons = document.getElementsByClassName("btn");
for(var i = 0; i <= buttons.length; i++){ buttons[i].click(); }