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
#include "mbed.h" | |
#include "SDFileSystem.h" | |
#include "EthernetInterface.h" | |
#include <stdio.h> | |
#include <string.h> | |
#define PORT 80 | |
EthernetInterface eth; |
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
const int pin = 8; | |
void setup() | |
{ | |
pinMode(pin, OUTPUT); | |
while (1) { | |
digitalWrite(8, HIGH); | |
digitalWrite(8, LOW); |
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
const int pin = 8; | |
void setup() | |
{ | |
pinMode(pin, OUTPUT); | |
volatile uint8_t* port = portOutputRegister(digitalPinToPort(pin)); | |
uint8_t mask = digitalPinToBitMask(pin); | |
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
void setup() | |
{ | |
DDRB |= (1 << 0); | |
while (1) { | |
PORTB ^= (1 << 0); | |
} | |
} | |
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
#include <SoftwareSerial.h> | |
SoftwareSerial Serial(2, 1); // RX, TX | |
const int analog_pin = A3; | |
int value; | |
void setup() | |
{ |
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
#include <TinyWireS.h> | |
#define I2C_SLAVE_ADDRESS 0x19 // the 7-bit address | |
#ifndef TWI_RX_BUFFER_SIZE | |
#define TWI_RX_BUFFER_SIZE (16) | |
#endif | |
#define CMD_LED_ON 0xA0 | |
#define CMD_LED_OFF 0xA1 |
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
#include <Wire.h> | |
#define I2C_SLAVE_ADDRESS 0x19 // the 7-bit address | |
#define CMD_LED_ON 0xA0 | |
#define CMD_LED_OFF 0xA1 | |
#define CMD_ADD_NUM 0xB0 | |
#define CMD_GET_RESULT 0xB1 | |
void setup() |
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
#include <Wire.h> | |
#define I2C_SLAVE_ADDRESS 0x4 // the 7-bit address | |
#define MEASURE_TEMPERATURE 0xA0 | |
#define SEND_TEMPERATURE 0xB0 | |
#define TEMP_CONST 10 // (1 Celcius == 10 mV) | |
#define TEMP_RESOLUTION 1024 // 2^10 (10 bits) | |
#define UNIT_CHANGE 1000 // (1V = 1000 mV) |
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
#define I2C_SLAVE_ADDRESS 0x4 // the 7-bit address | |
// Get this from https://github.com/rambo/TinyWire | |
#include <TinyWireS.h> | |
// The default buffer size, though we cannot actually affect it by defining it in the sketch | |
#ifndef TWI_RX_BUFFER_SIZE | |
#define TWI_RX_BUFFER_SIZE (16) | |
#endif |
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
#include <stdbool.h> | |
#include <stdint.h> | |
#include "inc/hw_types.h" | |
#include "inc/hw_ints.h" | |
#include "inc/hw_memmap.h" | |
#include "inc/hw_apps_rcm.h" | |
#include "driverlib/interrupt.h" | |
#include "driverlib/pin.h" | |
#include "driverlib/gpio.h" | |
#include "driverlib/prcm.h" |
OlderNewer