Skip to content

Instantly share code, notes, and snippets.

View murilopontes's full-sized avatar
:octocat:

Murilo Pontes murilopontes

:octocat:
  • Lisboa
  • 19:57 (UTC +01:00)
View GitHub Profile
@murilopontes
murilopontes / wifi_connect.cs
Last active July 10, 2017 11:03
programmatically connect to WiFi access points
// from https://github.com/DigiExam/simplewifi
using SimpleWifi;
// Wifi object
Wifi wifi = new Wifi();
// get list of access points
IEnumerable<AccessPoint> accessPoints = wifi.GetAccessPoints();
@murilopontes
murilopontes / test_all_usarts.c
Last active March 1, 2017 00:03
Stellaris / Tiva C - Testing all USARTs using Energia IDE
// Stellaris / Tiva C - Testing all USARTs
void setup()
{
pinMode(40,1);
Serial.begin(115200);
Serial1.begin(115200);
Serial1.setPins(UART1_PORTB); //trick to active USART1 without overlap USART4
Serial2.begin(115200);
@murilopontes
murilopontes / WindowsTap.cs
Last active October 11, 2016 15:52
Windows TAP Interface
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.IO;
using System.IO.Ports;
using System.Runtime.InteropServices;
namespace WindowsTapSpace
@murilopontes
murilopontes / GY-GPS6MV1.c
Created March 23, 2014 21:24
Stellaris / Tiva C - GY-GPS6MV1 - GPS Ublox NEO 6M
// Stellaris / Tiva C - GY-GPS6MV1 - GPS Ublox NEO 6M
// Use Energia IDE from http://energia.nu
//Wires
// GY-GPS6MV1 | Tiva
// VCC ---------- VBUS
// TX ---------- PB0
// RX ---------- PB1
// GND ---------- GND
uint32_t ulUser0, ulUser1;
ROM_FlashUserGet(&ulUser0, &ulUser1);
uint8_t* p_mac0;
uint8_t* p_mac1;
p_mac0 = (uint8_t*) &ulUser0;
p_mac1 = (uint8_t*) &ulUser1;
UARTprintf("mac=%02x-%02x-%02x-%02x-%02x-%02x\n",p_mac0[0],p_mac0[1],p_mac0[2],p_mac1[0],p_mac1[1],p_mac1[2]);
/*
Tiva C / Stellaris LM4F120XL
SCA ---> PA6
SDA ---> PA7
*/
//I2C lib
#include <Wire.h>
////////////////////////////////////////////
/*
Arduino Nano V3
SDA ---> A4
SCL ---> A5
*/
//I2C lib
#include <Wire.h>
////////////////////////////////////
//i2c lib
#include <Wire.h>
TwoWire i2c_port(2);
#include <stdarg.h>
void debug(char *fmt, ... ){
char buf[128]; // resulting string limited to 128 chars
va_list args;
#define HCSR04_TRIG PD_3
#define HCSR04_ECHO PD_2
void setup()
{
Serial.begin(115200);
pinMode(HCSR04_TRIG,OUTPUT);
pinMode(HCSR04_ECHO,INPUT);
}
#include <SPI.h>
#include <AIR430BoostFCC.h>
// -----------------------------------------------------------------------------
/**
* Defines, enumerations, and structure definitions
*/
#define ADDRESS_LOCAL 0x01