Difference between revisions of "Blog 21"

From BitWizard WIKI
Jump to: navigation, search
Line 1: Line 1:
 +
 +
== !BETA! ==
 +
 +
 
This is used for both projects:
 
This is used for both projects:
  
Line 13: Line 17:
  
 
== Connecting the analog meters ==
 
== Connecting the analog meters ==
 +
 +
While making the analog meter clock, I encountered the problem. That I had one Alternative current voltage. For this I had to
 +
 +
// blabla
 +
checked it out by putting the power resource after the diode.
 +
 +
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
 +
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
 +
And removed the connection with the normal resistor.
 +
// blabla
 +
 +
To check if the meter you have work on the DIO.
 +
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
 +
The pointer will directly go to it's to the right.
 +
( If he doesn't you have to remove some resistors )
 +
 +
To connect the meters on the DIO:
 +
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
 +
On the wiki page of [[DIO]] you can see, which pin is what.
  
  
Line 41: Line 64:
 
So, if you you want pin 4(IO1) and pin 6(IO3) on:
 
So, if you you want pin 4(IO1) and pin 6(IO3) on:
 
  IO1 + IO3 -> 02 + 08 = 0A
 
  IO1 + IO3 -> 02 + 08 = 0A
 +
 +
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
  
 
=== Making the sticker ===
 
=== Making the sticker ===
Line 52: Line 77:
  
  
== DIO Analog meter clock ==
+
== DIO Analog meter - Clock ==
 
 
 
 
== DIO Cooking timer ==  
 
  
  
 +
== DIO Analog meter - Cooking timer ==
  
  
  
{| border=1
 
! Pin !! Function !! Value
 
|-
 
| 3 || IO0 || 01
 
|-
 
| 4 || IO1 || 02
 
|-
 
| 5 || IO2 || 04
 
|-
 
| 6 || IO3 || 08
 
|-
 
| 8 || IO4 || 10
 
|-
 
| 9 || IO5 || 20
 
|-
 
| 10 || IO6 || 40
 
|}
 
  
  

Revision as of 17:04, 14 December 2015

!BETA!

This is used for both projects:

Hardware used on Raspberry Pi:

Programmed with:

Connecting the analog meters

While making the analog meter clock, I encountered the problem. That I had one Alternative current voltage. For this I had to

// blabla checked it out by putting the power resource after the diode.

To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum. Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors. And removed the connection with the normal resistor. // blabla

To check if the meter you have work on the DIO. Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2). The pointer will directly go to it's to the right. ( If he doesn't you have to remove some resistors )

To connect the meters on the DIO: I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 ) On the wiki page of DIO you can see, which pin is what.


Change analog meter value through the command line

Recommended to use the DIO protocol.

I have in my example the analog meter connected with pin 3(IO0).

Pin 3 is IO0, so it will get the first value and that is one.

To set pin 3 as output:

bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01

To enable the PWM:

bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01

To let the pointer go to 50% of the analog meter:

bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80

The value is in hexadecimals so that is why 80 is 50%.

If you are going to use a pin like pin 10(IO6). With the value 40 for register 30 and 5f. The reason it is 40 is, because the bits are in hexadecimals. So, 64 decimal bits gets calculated to 40 hexadecimals.

The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command. So, if you you want pin 4(IO1) and pin 6(IO3) on:

IO1 + IO3 -> 02 + 08 = 0A

For the full Bit Mask list of values you have to go to the DIO protocol

Making the sticker

DIO Analog meter - Clock

DIO Analog meter - Cooking timer

Useful links