How to Make a Transaction in IOTA

from iota import *

api = Iota('https://host', 'SampleSeed')

pt = ProposedTransaction(address = Address('SampleOutput'), value = 100)

in_addy = Address('SampleInput') # 0 or more

ch_addy = Address('SampleChange') # 0 or 1

api.send_transfer(transfers = [ pt ], inputs = [ in_addy ], change_address = [ ch_addy ])
Advertisements

How to Get Voltage with a Grove Voltage Divider in Raspberry Pi

W/ Base Hat

1) Connect the module to the A0 port.

2) Install the GrovePi library.

3) Run the following code:

from grovepi import *

PIN = 2

pinMode(PIN, 'INPUT')

while True:
  print 3 * analogRead(PIN) * 5 / 1023.0

W/ Protoboard

Directly