sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
DeviceGeneric.ino File Reference

Example-Code for a generic ATTiny85 Device (e.g. Sensor, Display) More...

#include <PJON.h>

Macros

#define ENABLE_UNITTEST
 
#define TEMP_OFFSET   -272.9
 
#define TEMP_COEFF   1.075
 
#define SENSOR   "owp:dg:tiny:v1"
 
#define READ_INFO   0x01
 
#define READ_VCC   0x11
 
#define READ_TEMP   0x12
 
#define READ   0x21
 
#define WRITE   0x22
 
#define WRITE_CAL   0x32
 
#define PJON_INCLUDE_SWBB   true
 
#define PJON_PACKET_MAX_LENGTH   30
 
#define PJON_MAX_PACKETS   0
 

Functions

PJON< SoftwareBitBang > bus (44)
 
void setup ()
 
void receiver_function (uint8_t *payload, uint16_t length, const PJON_Packet_Info &packet_info)
 
void loop ()
 
float readVcc ()
 
float readTemp (void)
 

Variables

uint8_t mem_buffer [16]
 

Detailed Description

Example-Code for a generic ATTiny85 Device (e.g. Sensor, Display)

Example-Code for a Si7021 ATTiny85 Device (e.g. Sensor, Display)

Author
drtrigon
Date
2018-08-08
Version
1.0
See Also
https://github.com/gioblu/PJON/wiki/ATtiny-interfacing
* OneWire PJON Generic "OWPG" scheme:
*   @ref OWPJON/LINUX/Local/LocalUDP/RemoteWorker/DeviceGeneric/DeviceGeneric.cpp
*
* Compatible with: atmega328 (Uno, Nano), atmega32u4 (Yun), attiny85
*
* Pinout:
*   ???
*
* Thanks to:
* gioblu - PJON 11.0 and support
*          @see https://www.pjon.org/
*          @see https://github.com/gioblu/PJON
* fredilarsen - support
* 
Author
drtrigon
Date
2019-01-26
Version
1.1
See Also
https://arduino.stackexchange.com/questions/4169/arduino-ide-ifdef
https://github.com/gioblu/PJON/wiki/ATtiny-interfacing

Tiny_OWSlave_OWH_DS18B20_thermo-hygrometer/Tiny_OWSlave_OWH_DS18B20_thermo-hygrometer.ino OWPJON/ARDUINO/Local/SoftwareBitBang/OWP_DG_1w-adaptor/OWP_DG_1w-adaptor.ino

* OneWire PJON Generic "OWPG" scheme:
*   @ref OWPJON/LINUX/Local/LocalUDP/RemoteWorker/DeviceGeneric/DeviceGeneric.cpp
*
* Compatible with: attiny85, atmega328 (Uno, Nano), atmega32u4 (Yun)
*
* Pinout:
*                      ATtinyX5 Pin Layout (ATtiny85)
*                                ---_---
*                                .     .
*                        RST PB5 |1   8| VCC      5V
* (via 220ohm to 1<-TX)   3  PB3 |2   7| PB2  2   SCL Adafruit_Si7021
*           OWPJON DATA   4  PB4 |3   6| PB1  1   (via 4.7k to LED on GND)
*                            GND |4   5| PB0  0   SDA Adafruit_Si7021
*                                -------
*
* Thanks to:
* gioblu - PJON 11.0 and support
*          @see https://www.pjon.org/
*          @see https://github.com/gioblu/PJON
* fredilarsen - support
* 

Macro Definition Documentation

#define ENABLE_UNITTEST
#define PJON_INCLUDE_SWBB   true
#define PJON_MAX_PACKETS   0
#define PJON_PACKET_MAX_LENGTH   30
#define READ   0x21
#define READ_INFO   0x01
#define READ_TEMP   0x12
#define READ_VCC   0x11
#define SENSOR   "owp:dg:tiny:v1"
#define TEMP_COEFF   1.075
#define TEMP_OFFSET   -272.9
#define WRITE   0x22
#define WRITE_CAL   0x32

Function Documentation

PJON<SoftwareBitBang> bus ( 44  )
void loop ( void  )

OneWirePJON device status update function.

Returns
(void)
float readTemp ( void  )

Internal Temperature Sensor for the ATtiny85 (not ATmega328).

Parameters
void
See Also
receiver_function()
https://github.com/cano64/ArduinoSystemStatus/blob/master/SystemStatus.cpp
http://21stdigitalhome.blogspot.ch/2014/10/trinket-attiny85-internal-temperature.html
Returns
The chip temperature in [°C]
float readVcc ( )

Accessing the secret voltmeter on the ATtiny85 (not ATmega328).

See Also
receiver_function()
http://code.google.com/p/tinkerit/wiki/SecretVoltmeter
Returns
The supply voltage in [V]
void receiver_function ( uint8_t *  payload,
uint16_t  length,
const PJON_Packet_Info &  packet_info 
)
void setup ( void  )

Arduino IDE: put your setup code here, to run once.

Variable Documentation

uint8_t mem_buffer[16]