Skip to content

Instantly share code, notes, and snippets.

View marcozecchini's full-sized avatar

Marco Zecchini marcozecchini

View GitHub Profile
@marcozecchini
marcozecchini / contracts...SimpleSale.sol
Created July 29, 2021 20:50
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
/**
* @dev This is an example contract implementation of NFToken with metadata extension.
*/
import "/contracts/MyCIHEAMToken.sol";
contract SimpleSale {
@marcozecchini
marcozecchini / contracts...SimpleSale.sol
Created July 29, 2021 20:49
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&runs=200&gist=
// this line is added to create a gist. Empty file is not allowed.
@marcozecchini
marcozecchini / contracts...MyCIHEAMToken.sol
Created July 27, 2021 18:04
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "https://github.com/0xcert/ethereum-erc721/src/contracts/tokens/nf-token-metadata.sol";
import "https://github.com/0xcert/ethereum-erc721/src/contracts/ownership/ownable.sol";
/**
* @dev This is an example contract implementation of NFToken with metadata extension.
*/
@marcozecchini
marcozecchini / contracts...SimpleAuction.sol
Created July 27, 2021 16:58
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
/**
* @dev This is an example contract implementation of NFToken with metadata extension.
*/
import "/contracts/MyPostiToken.sol";
contract SimpleAuction {
@marcozecchini
marcozecchini / contracts...SimpleAuction.sol
Created July 27, 2021 16:58
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
/**
* @dev This is an example contract implementation of NFToken with metadata extension.
*/
import "/contracts/MyPostiToken.sol";
contract SimpleAuction {
@marcozecchini
marcozecchini / contracts...ERC-721.sol
Created July 1, 2021 15:12
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "https://github.com/0xcert/ethereum-erc721/src/contracts/tokens/nf-token-metadata.sol";
import "https://github.com/0xcert/ethereum-erc721/src/contracts/ownership/ownable.sol";
/**
* @dev This is an example contract implementation of NFToken with metadata extension.
*/
const fs = require('fs');
const path = require('path');
const algosdk = require('algosdk');
const { countReset } = require('console');
const baseServer = 'https://testnet-algorand.api.purestake.io/ps2';
const port = '';
const token = {
'X-API-Key': 'F9I45UDrFb9FuoYhohD35A2Tcfq0mnZ5cTuG81x9',
import paho.mqtt.client as mqtt
def on_connect(client, userdata, flags, rc):
print("Connected with result code "+str(rc))
# Subscribing in on_connect() means that if we lose the connection and
# reconnect then subscriptions will be renewed.
client.subscribe("+/devices/+/up")
# The callback for when a PUBLISH message is received from the server.
Company 1
Measurements 4.5 5.5 8.5 7.8 9.0
Percentage 80% 60% 40% 20% 10%
Threshold 4.0 4.5 6.5 8.0 9.0
Company 2
Measurements 3.5 3.8 6.0 8.5 9.0
Percentage 80% 60% 40% 20% 10%
#include <avr/pgmspace.h>
#include <EEPROM.h>
#include <OneWire.h>
#define DoSensorPin A4 //dissolved oxygen sensor analog output pin to arduino mainboard
#define TemperaturePin A0
#define VREF 5000 //for arduino uno, the ADC reference is the AVCC, that is 5000mV(TYP)
float doValue; //current dissolved oxygen value, unit; mg/L
float temperature = 25; //default temperature is 25^C, you can use a temperature sensor to read it