This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function points = guilloches(Theta, R, r, p) | |
points = []; | |
for theta = Theta, | |
x = (R+r)*cos(theta) + (r+p)*cos(((R+r)/r)*theta); | |
y = (R+r)*sin(theta) + (r+p)*sin(((R+r)/r)*theta); | |
points = [ points; x, y ]; | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am gonium on github. | |
* I am gonium (https://keybase.io/gonium) on keybase. | |
* I have a public key whose fingerprint is E7BA B68E A2D3 9B6A ECEF 4DE4 823E 0DBE B650 1625 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
memset(&switchmsg, 0, sizeof(switchmsg)); | |
strncpy(switchmsg.type, "HEXABUS", sizeof(switchmsg.type)); | |
switchmsg.source = 1; | |
if (strcmp(argv[2], "on") == 0) { | |
printf("sending ON command\r\n"); | |
switchmsg.command=htons(ON); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void | |
udphandler(process_event_t ev, process_data_t data) | |
{ | |
char buf[UDP_DATA_LEN]; | |
struct hexabusmsg_t *hexabuscmd; | |
if (ev == tcpip_event) { | |
if(uip_newdata()) { | |
PRINTF("udp_handler: received '%d' bytes from ", uip_datalen()); | |
PRINT6ADDR(&UDP_IP_BUF->srcipaddr); | |
hexabuscmd = (struct hexabusmsg_t *)uip_appdata; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROCESS_THREAD(udp_handler_process, ev, data) { | |
uip_ipaddr_t ipaddr; | |
PROCESS_POLLHANDLER(pollhandler()); | |
PROCESS_EXITHANDLER(exithandler()); | |
// see: http://senstools.gforge.inria.fr/doku.php?id=contiki:examples | |
PROCESS_BEGIN(); | |
PRINTF("udp_handler: process startup.\r\n"); | |
// wait 3 second, in order to have the IP addresses well configured | |
etimer_set(&udp_periodic_timer, CLOCK_CONF_SECOND*3); |