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
// PIC16F1579 Configuration Bit Settings | |
// CONFIG1 | |
#pragma config FOSC = INTOSC // Oscillator Selection Bits (INTOSC oscillator; I/O function on CLKIN pin) | |
#pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled) | |
#pragma config PWRTE = ON // Power-up Timer Enable (PWRT enabled) | |
#pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input) | |
#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) | |
#pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled) | |
#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT 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
// PIC16F1579 Configuration Bit Settings | |
// CONFIG1 | |
#pragma config FOSC = INTOSC // Oscillator Selection Bits (INTOSC oscillator; I/O function on CLKIN pin) | |
#pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled) | |
#pragma config PWRTE = ON // Power-up Timer Enable (PWRT enabled) | |
#pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input) | |
#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) | |
#pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled) | |
#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT 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
// PIC16F1579 Configuration Bit Settings | |
// CONFIG1 | |
#pragma config FOSC = INTOSC // Oscillator Selection Bits (INTOSC oscillator; I/O function on CLKIN pin) | |
#pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled) | |
#pragma config PWRTE = ON // Power-up Timer Enable (PWRT enabled) | |
#pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input) | |
#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) | |
#pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled) | |
#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT 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
// PIC16F1579 Configuration Bit Settings | |
// CONFIG1 | |
#pragma config FOSC = INTOSC // Oscillator Selection Bits (INTOSC oscillator; I/O function on CLKIN pin) | |
#pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled) | |
#pragma config PWRTE = ON // Power-up Timer Enable (PWRT enabled) | |
#pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input) | |
#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) | |
#pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled) | |
#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT 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
#include "mcc_generated_files/mcc.h" | |
#include <stdio.h> | |
void move(unsigned char direction) | |
{ | |
if (direction == 1) { | |
PWM1_DutyCycleSet(639); | |
PWM1_LoadBufferSet(); | |
} else { |
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
ORG 0 | |
RAMTOP | |
CLRF 0x20 | |
INCF 0x20, 1 | |
LOOP | |
RLF 0x20, 1 | |
GOTO LOOP | |
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
ORG 0 | |
RAMTOP | |
CLRF 0x20 | |
CLRW | |
CALC | |
INCF 0x20 | |
ADDWF 0x20, 0 | |
BTFSS 0x20, 4 |
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 "p16f1579.inc" | |
; CONFIG1 | |
; __config 0xFFA4 | |
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOREN_ON & _CLKOUTEN_OFF | |
; CONFIG2 | |
; __config 0xDEFF | |
__CONFIG _CONFIG2, _WRT_OFF & _PPS1WAY_ON & _PLLEN_OFF & _STVREN_ON & _BORV_LO & _LPBOREN_OFF & _LVP_OFF | |
ORG 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
__CONFIG 0x8007, 0xFFA4 | |
ORG 0 | |
RAMTOP | |
MOVLB 0x1 | |
MOVLW b'00010010' | |
MOVWF 0x99 | |
CLRF 0x8E | |
MOVLB 0x3 |
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
#coding:utf-8 | |
import serial | |
device = '/dev/ttyUSB0' | |
ser = serial.Serial(device, baudrate=9600) | |
mascon_level = -1 # init | |
static_mascon_level = -1 # init | |
buttons = -1; |