Add files via upload

This commit is contained in:
Jonas Niesner
2025-03-07 18:37:15 +01:00
committed by GitHub
parent fd08196b54
commit 607acca92e
4 changed files with 90 additions and 36 deletions

View File

@@ -0,0 +1,51 @@
{
"build": {
"arduino":{
"ldscript": "nrf52_xxaa.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52_DK",
"f_cpu": "64000000L",
"mcu": "nrf52840",
"variant": "nRF52DK",
"zephyr": {
"variant": "nrf52840dk_nrf52840"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"default_tools": [
"jlink"
],
"jlink_device": "nRF52840_xxAA",
"onboard_tools": [
"cmsis-dap",
"jlink"
],
"svd_path": "nrf52840.svd"
},
"frameworks": [
"arduino",
"mbed",
"zephyr"
],
"name": "HGD6 nRF52840",
"upload": {
"maximum_ram_size": 262144,
"maximum_size": 1048576,
"protocol": "jlink",
"protocols": [
"jlink",
"nrfjprog",
"stlink",
"blackmagic",
"cmsis-dap",
"mbed"
]
},
"url": "https://unknown.org",
"vendor": "Unknown"
}

View File

@@ -10,7 +10,7 @@
[env:nrf52840_dk]
platform = nordicnrf52
board = nrf52840_dk
board = hgd6
framework = arduino
board_build.variants_dir = variants
board_build.variant = hgd6
@@ -18,3 +18,5 @@ lib_deps =
adafruit/Adafruit Unified Sensor@^1.1.15
adafruit/Adafruit LIS3DH@^1.3.0
sparkfun/SparkFun Ambient Light Sensor Arduino Library@^1.0.4
build_unflags = "-DNRF52"
build_flags = "-DNRF52840_XXAA"

View File

@@ -43,16 +43,30 @@ void setup() {
Wire.begin();
//set i2c pins
pinMode(15, OUTPUT);
//initial watchdog feeding, necessary to avoid reset. this has to be in this position because otherwise i2c dies
//needed for some boards
in1_handler();
}
int ptt = 34;
void loop() {
Serial.println("loop");
busscan();
measuretemp();
lightsense();
delay(1000);
pinMode(29,OUTPUT);
digitalWrite(29,HIGH);
pinMode(34,OUTPUT);
digitalWrite(34,HIGH);
delay(600);
digitalWrite(34,LOW);
delay(600);
//testallpins();
//measuretemp();
//lightsense();
//pinMode(ptt,OUTPUT);
//digitalWrite(ptt,HIGH);
//delay(100);
//digitalWrite(ptt,LOW);
//delay(100);
}
void test1pin(int i,int d){
@@ -155,14 +169,17 @@ void busscan(){
}
void testallpins(){
for (size_t i = 0; i < 64; i++){
for (size_t i = 36; i < 64; i++){
if(i != 2 && i != 29){
Serial.println(String(i));
pinMode(i, OUTPUT);
digitalWrite(i, HIGH);
delay(50);
digitalWrite(i, LOW);
delay(50);
for (size_t j= 0; j < 50; j++)
{
pinMode(i, OUTPUT);
digitalWrite(i, HIGH);
delay(50);
digitalWrite(i, LOW);
delay(50);
}
}
}
}
}

View File

@@ -1,26 +1,10 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _VARIANT_GENERIC_
#define _VARIANT_GENERIC_
#include "nrf.h"
#include "nrf_peripherals.h"
/** Master clock frequency */
#if defined(NRF52_SERIES)
#define VARIANT_MCK (64000000ul)
#else
@@ -81,19 +65,19 @@ static const uint8_t A5 = PIN_A5 ;
* Serial interfaces
*/
// Serial
#define PIN_SERIAL_RX (17) // P0.00
#define PIN_SERIAL_TX (22) // P0.01
#define PIN_SERIAL_RX (32)
#define PIN_SERIAL_TX (33)
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 1
#define PIN_SPI_MISO (12) // P0.22
#define PIN_SPI_MOSI (41) // P0.23
#define PIN_SPI_SCK (24) // P0.24
#define PIN_SPI_MISO (12)
#define PIN_SPI_MOSI (41)
#define PIN_SPI_SCK (24)
static const uint8_t SS = 25 ; // P0.25
static const uint8_t SS = 25 ;
static const uint8_t MOSI = PIN_SPI_MOSI ;
static const uint8_t MISO = PIN_SPI_MISO ;
static const uint8_t SCK = PIN_SPI_SCK ;